Debian – How to set up RAID1 with both disks bootable on Debian/Ubuntu

debiandebian-squeezemdadmraid1

In Debian 6, new installation, what is the recommended way of setting up a software RAID1 array so that the system is bootable from both disks?

I have heard that people that don't know what they are doing may set it up in such a way that the system becomes unbootable if the primary disk fails (!)

I haven't been able to find a simple listing of steps for the latest version of Debian.

Best Answer

I have done this before a year or so back to a few servers. It is a bit of a pain but doable. Its easier if you have hardware raid.

When I did it to a debian box I followed this awesome guide that saved me because there are many steps involved and it is a pain the arse if you get it wrong.

In short, you use mdadm to create your two partitions (md0/md1) (root/swap) do some copying on the guide, edit your boot menu do a few reboots and get the two drives in sync. Once you have them in sync you will be able to pull out each drive, and boot from it. Make sure you test it works though, and re-syncs the drives.