Virtualization - Step 1 Installation and Raid-1

I got my new server on Friday, so the first step was to get Linux installed with the boot partition mirrored. I started from a Linux Raid HOWTO that I found on the web. I looked at several different versions of this HOWTO and they all seemed to agree on the basics. That is, they all said that you need to install Linux to a non-raid partition, then create your raid array, copy the installed OS to the array and then fiddle LILO to point to the Raid array. I wasted most of Saturday trying to get this approach to work, only to find out that nothing could be further from the truth. With Slackware, all you need to do is create the Raid array before running setup and then install directly to the Raid array.

Here is how I finally got it to work:

  • Boot Slackware from DVD
  • Login as root
  • Use cfdisk (or fdisk) to create an identical set of partitions on both drives. I chose to create an 8GB swap partition, 200GB root partition and a 40GB spare partition on both drives.
  • Use mdadm to create the Raid array. The command looked like this:
    mdadm –create /dev/md0 –raid-devices=2 –chunk=32 –level=1 –auto=yes
    /dev/sda2 /dev/sdb2
  • Run setup. When it asks where you want to install the OS the Raid array (/dev/md0) will be shown as one of the options. Just select it as your target partition.

When setup finishes reboot the system. One of the first things that will happen is Linux will start to sync both halves of the Raid array. On my system this took about 40 minutes. You can still use the system while this is going on, it will just be a bit slow.

Like most things with Linux, this turned out to be quite easy once you know how to do it.

Leave a Reply