Posts

Showing posts from July, 2008

NFS server Redhat 5

Making NFS server Live: Server side (Server IP 10.1.31.1): 1. Check nfs-utils is installed or not using #yum list nfs-utils 2. Edit /etc/exports , add dir you want share with netrwork information and permision # vi /etc/exports /var/ftp/pub 10.1.0.0/16(rw,sync,no_root_squash) 3. Restart nfs service # service nfs retstart or # service nfs reload 4. Check port & shared dir using # rcpinfo -p # export -v # service portmap status Client Side (Client IP : 10.1.0.0/16, eg 10.1.31.67): 1. mount shared nfs folder # mount 10.1.31.3:/var/ftp/pub /mnt 2. Do static mount using /etc/fstab # vi /etc/fstab 10.1.31.1:/var/ftp/pub /mnt nfs defaults 0 0

Creating RAID Partition

Creating RAID-5 For this you need 3 Partition, 2 partitions with same size and 3rd partition is 10% greater than 1st or 2nd( since 1 & 2nd partition of same size. ). You can use fdisk command to create partition and make sure partition type must be FD. In fdisk command use option t to change partition type. eg. I have created /dev/sda1, /dev/sdb1 and /dev/sdc1. Once you created 3 partitions use this to make RAID 5: #mdadm --create /dev/md0 --level=5 --raid-device=3 /dev/sd{a1,b1,c1} Check the RAID partition using: #less /proc/mdstat Or you can see detail information's using: #mdadm --detail /dev/md0 To rebuild corrupted partation use: #mdadm /dev/md0 -r /dev/sdb0

Swap Filesystem Creation

Partition Creation for Swap filesystem 1. fdisk -l 2. fdisk /dev/sda 3. Type p & Press Enter 4. Type n & Press Enter 5. Just Press Enter for 1st Cylinder size 6. Type +sizeM for last Cylinder size 7. Type p & Press Enter 8. Type t & Press Enter 9. t2 /dev/sda12 10. Type 82 & Press Enter 11. Type p & Press Enter 12. Type w & Press Enter 13. partprobe 14. swapon -s 15. swapoff /dev/sda7 => Swapoff the another swap partition 16. swapon -s Creation of a new Swap Filesystem 1. mkswap -v1 /dev/sda12 2. swapon /dev/sda12 3. swapon /dev/sda7 Here /dev/sda7 & /dev/sda12 are swap partition. For automounting the either or swap partition do the following : 1. vi /etc/fstab 2. Add the following line :- /dev/sda12 swap swap defaults 0 0 Note :- Partition Id identifies what type of filesystem will have to create. Id

Linux partition using fdisk

Linux partition using fdisk 1. fdisk -l => To check what type of Hard Disk i.e. Sata ( /dev/sda ) or Pata ( /dev/hda ) 2. fdisk /dev/sda 3. Type n then Enter => For new Partition 4. Just press Enter => For 1st Cylinder 5. Type +size and press Enter => For Last Cylinder for Example +1000M. Size can be in terms of M or K 6. Type p => To print the partition 7. Type w => To save the new partition. It's save in the hard disk but kernel partition table not updated. (/dev/sda11 is created in my system , might be different in your system) 8. Type partprobe & Press Enter => To update the kernel. 9. mkfs.ext3 -b 2048 /dev/sda11 => Here b is the block & is \block size in bytes & /dev/sda11 is new partition has created 11. e2label /dev/sda11