Linux Raid Guide
4. Making the array
The original way to manage RAID setups were the “raidtools”. These have been deprecated by mdadm, that is much more convenient. Check if you have mdadm installed, it is included in most distributions. You can otherwise try to install from the latest source package (./configure ; make ; make install should suffice) or obtain a package suitable for your distribution. Check to see whether it is available:
Making the arrayOK, now that you have made the partitions, verified kernel support and the existence of mdadm on your system, it is time to build the actual array.
At this point, the two disks will start syncing and /proc/mdstat should show something like this:
You can start formatting the array at this point, even while the synchronization proceeds in the background. Use your favorite filesystem. Something like:
Congratulations! You now have a working RAID-1 partition! Make sure to add it in /etc/fstab and start using it right away. Here is an example line from /etc/fstab:
At this point, it would be wise to save your configuration in the /etc/mdadm.conf file. Do this with the following command:
Make sure to read the mdadm manual. There are some very interesting options, like the ability to check the array automatically and the ability to recreate an array that has gone out of sync. You should know in advance how to rebuild the array without losing data if you need to replace a failed hard disk. It's not hard, but make sure to read the instructions and have them printed some where, along with the contents of your mdadm.conf file.