Thursday, March 31, 2011

RAID 5 Configuration in RHEL5.3

Step 1: Create 3 partitions by using #fdisk /dev/sda (say /dev/sda6, /dev/sda7, /dev/sda8) and change the system id as fd (Linux raid autodetect)
Step 2: #partprobe or #reboot -f
Step 3: #mdadm -C /dev/md0 -l 5 -n 3 /dev/sda6 /dev/sda7 /dev/sda8
            #mkfs.ext3 /dev/md0
Step 4: #mkdir /raid5
            mount in /etc/fstab (/dev/md0  /raid5 ext3 defaults 0 0) (add an entry in /etc/fstab)
            #mount -a
Step 5: #mdadm --detail /dev/md0 (viewing the raid device)
            #cat /proc/mdstat (viewing the raid device configuration)
Step 6: #mdadm -f /dev/md0 /dev/sda8 (disabling device from the existing RAID)
           #mdadm -a /dev/md0 /dev/sda9 (adding a new device in the existing RAID)
           #mdadm -r /dev/md0 /dev/sda8 (for removing a device from the existing RAID)

0 Comments: