Friday, 10 August 2012

RAID



#fdisk /dev/sda
#create 3 partition (/dev/sda6 /dev/sda7 /dev/sda8) with space 100M the partition type should be “fd”
#init 6
#format the above created 3 partitions
#mdadm  --create  /dev/md0 --level=5 --raid-disk=3 /dev/sda6 /dev/sda7 /dev/sda8 {for create raid partition)
#mke2fs -j  /dev/md0
#mkdir /raid
#mount /dev/md0 /raid or use /etc/fstab for permanent mount
#mdadm --detail /dev/md0   - for verify all raid partition are working fine (u can use #cat /proc/mdstat also)
#cp some folder or files  to /raid
#Now assume that hard disk /dev/sda6 is failed
#mdadm /dev/md0 –fail /dev/sda6 – command to make the partition gets fail.
#mdadm --detail /dev/md0 – verify whether the /dev/sda6 has failed or not.
#mdamd /dev/md0 –remove /dev/sda6 – remove the faulty disk from raid (note u must to set fail status before removing the hard disk)
#mdadm /dev/md0 –add /dev/sda6 – to add the new partition in raid
 
How to remove the raid devices
#umount /raid
#mdadm –stop /dev/md0
#mdadm –remove /dev/md0
#remove entry from /etc/fstab 
#fdisk /dev/sda
#delete the partition /dev/sda6 /dev/sda7 /dev/sda8
 
 
In real time environment work
(***YOU MUST CREATE 3 PARTITION WITH 3 DIFFERENT HDD***) FOR RAID CREATTION.
 
 

No comments:

Post a Comment