-->
  • Recent Articles

    Linux software Raid -- Create, Configure, Troubleshooting

    We can Have Multiple Disks or Create partitions on a Single Disk. As to test I'll create the partitions on a Single disk and Simulate the Linux RAID to you. Do write your Comment/Like/Suggestions or Questions if you have any. 

    My OS is SuSE Linux 11 SP3. I've a SCSI disk attached to my host. So the disk named as /dev/sda. I'll demonstrate 2 types of RAID for you here. 1st example is for RAID 5.


    1. Create the new partition.




    Choose First and last Sector. Then Change the partition system Id to "fd" in fdisk with option "t". So create 3 partition of same size to create the RAID 5.



    Now Save the partition table with "W". Now you can check the partitions.  You will not find newly created partitions. Please run "partprobe" to get the kernel read new partition table. Please the partitions now. 




    Now we are all set to create a RAID. I'm listing the Commands for you.I'll explain it for you as well.




    Step 1: Create raid device "md0", which is of layout (-l) of RAID 5 and consists 3 disks (-n).

    Step 2: df -h
    Step 3: Create file system on RAID.
    Step 4: Create mount point.
    Step 5: make an persistent entry in /etc/fstab.
    Step 6: mount the file system.
    Step 7: df -h to check the file system is mounted.



    You can see 3 Active devices with No Spare Disk. You can do it with following command aswell "mdadm -D /dev/md0".


    Now we'll see if  One of the disk fails, what happens to the file system.



    I've simulate the disk failure with "-f" option. You can still access the file system and create files as well. You can see the "Failed Devices" count as 1. Now we will see how to replace the new disk in the RAID.



    Remove the faulty device from the RAID first. And the New disk, In our case it was the same partition as we are simulating failure. The RAID will re-build itself.




    The Job not done yet. We need to create the RAID config file and start the RAID devices after reboot.




    1. Examine all the current md devices and made a entry in mdadm.conf file. Then link the "boot.md" to server startup. On the "mdadmd" services through chkconfig. We are all done now. Cheers.





    No comments