Linux: using md to get RAID5

If you liked my RAID 1 HOWTO, you will sure like this one too. However, this time I had decent hardware. Goal was to make machine with cca. 800 Gb of disk space which is also stable as in: I don't want one failing disk to bring machine down. This goal proved to be correct because in first two days, one of disks failed. Server survived without any loss of data.

For this project I used:

Procedure involves many steps, and some of them must be performed in this order. However, that is not the only possible order. Helpful hints are marked specially.

We had 8 disks, 120 Gb each. Since you can't boot from RAID 5, we also created some RAID 1 volumes (for root /, /usr, and /var and last two for swap). So, layout is:

disk partitioncontent partitioncontent
1 hda1root / RAID 1 (mirror) hda2/raid RAID 5
2 hdc1 hdc2
3 hde1/usr RAID 1 (mirror) hde2
4 hdg1 hdg2
5 hdi1/var RAID 1 (mirror) hdi2
6 hdl1 hdl2
7 hdn1swap (not mirrored) hdn2
8 hdo1swap (not mirrored) hdo2
Hint: As you can see, not all our disks are masters. That shouldn't matter, but take some extra time to make them masters so that you have neatly organized server.

Now, let's do a walk-through:

This is more-or-less all what you have to do. Your RAID will work from now on, and only important command is raidhotadd with which you can add disk if one of them fail.

Failure recovery procedure is: