Setting up a NIS server over CentOS5 working under nfs
Server side: Preparing
The /etc/hosts has to be like this. (you can replace the domain to whatever you desire, but on this exercise it was defined as “queirozpacheco.com”.
[root@server ~]# cat /etc/hosts
192.168.1.13 server server.queirozpacheco.com yum.queirozpacheco.com
192.168.1.14 host host.queirozpacheco.com
[root@server ~]#
Connecting host via ssh – let’s make the things turning out much easier for us.
[root@server ~]# ssh host
root@host’s password: (press ctrl + C)
So, in this step, press Ctrl + c and send the key pub generated by the server to the host client.
[root@server ~]# cat /root/.ssh/id_rsa.pub | ssh host “cat – > /root/.ssh/authorized_keys”
root@host’s password:
The server doesn’t ask for any password to grant access to you.
[root@server ~]# ssh host
Last login: Mon Feb 22 21:24:17 2010
[root@host ~]#
Client Side: Preparing.
[root@host etc]# cat /etc/hosts
192.168.1.14 host host.queirozpacheco.com
192.168.1.13 server server.queirozpacheco.com yum.queirozpacheco.com
[root@host etc]#
Growing a Raid 5. It has never been easier.
Add a new disk and prepare it with 3 partitions 6GB of size as well as the file system type as “fd”. It has to be like this: you can create whatever size you desire, it doesn’t matter. On one condition: It must have the same size to others partitions else of your array.
[root@carlosqueiroz ~]# sfdisk -l /dev/hdd
Disk /dev/hdd: 41610 cylinders, 16 heads, 63 sectors/track
Units = cylinders of 516096 bytes, blocks of 1024 bytes, counting from 0Device Boot Start End #cyls #blocks Id System
/dev/hdd1 0+ 11905 11906- 6000592+ fd Linux raid autodetect
/dev/hdd2 11906 23811 11906 6000624 fd Linux raid autodetect
/dev/hdd3 23812 35717 11906 6000624 fd Linux raid autodetect
/dev/hdd4 0 – 0 0 0 Empty
[root@carlosqueiroz ~]#
Setting a Raid5- the party hasn’t finished.
Let’s check out the survey below. We can find here two disks and one of them there’s no partition created. This one will be our raid. I’ll define 3 partitions
of 6 GB each of them. How smallest is the size of that, Less is the waiting time to create the array, I mean, you can spend some time on it. As it is an example, I’ll set all of these partitions as 6GB.
[root@carlosqueiroz ~]# fdisk -l
Disk /dev/hda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 102 714892+ 82 Linux swap / Solaris
/dev/hda3 103 1305 9663097+ 83 LinuxDisk /dev/hdb: 21.4 GB, 21474836480 bytes
16 heads, 63 sectors/track, 41610 cylinders
Units = cylinders of 1008 * 512 = 516096 bytesDevice Boot Start End Blocks Id System
[root@carlosqueiroz ~]#
RAID I – from a normal file system. This party is by invitation only :)
As we can see, the survey found is a simple server installed to use normal store file system.
[root@carlosqueiroz /]# fdisk -l
Disk /dev/hda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 1215 9655065 83 Linux
/dev/hda3 1216 1304 714892+ 82 Linux swap / Solaris
[root@carlosqueiroz /]#Check out how mount points are.
[root@carlosqueiroz ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda2 9.0G 969M 7.6G 12% /
/dev/hda1 99M 12M 83M 12% /boot
tmpfs 172M 0 172M 0% /dev/shm
[root@carlosqueiroz ~]#
Installing a server based on LVM on Centos 5.4
This new generation gets over all what I’ve expected. When I was gonna resize a partition I used to do this task either partition magic for Windows or resize2fs for Linux ext3 file systems and sometimes it was resized for breakfast, don’t misunderstood me, but it’s not definitely the most safe way to resize partitions. I know there are many ways to implement it, but for now I’m running for LVM :P
Today there are many tools available to resize a partition, however when we’re talking about a critical server in output which it has incorporated raid and unstoppable services, we need to design better how the information will be stored as well as implementing a file system more dynamic.
Here are the steps for installing a server based on LVM.
Applying quotas on Linux file systems.
Some reasons to set up a quota disk on your server. I’ll tell some of those on the most basic way to be understood.
You could manage from the beginning the space in disk on your server applying quotas. It allows you to fix a disk quota for some user and group. It’ll determine how the size leftover a certain user could be stored.
I’ll post step by step, how to configure file systems using disk quota.
For now, we’ve got our partition disk configured like this: You definitely don’t need to follow this partition layout of course but it’s recommended apply quotas in a partition independent from root file system, although it allows you to do it.