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.

  • I have only seen that fail when people failed to install the boot-loader to both drives. \n \n E.g. after using \n mdadm --create /dev/md0 --level=mirror --raid-devices=2 /dev/sda1 /dev/sdb1 \n and pointing GRUB or LILO to /dev/sda1 \n – Hennes Jan 5 '13 at 11:56
  • @Hennes where did you buy all the \n? I want some too. – the-wabbit Jan 5 '13 at 14:24
  • Newlines gone not quite right. – Hennes Jan 5 '13 at 14:27

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.

  • I was hoping for a more concise answer (the tutorial is quite long), but since your answer is the only one, I will accept it. Thank you! – W3Coder Jan 14 '13 at 14:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.