Root on LVM on RAID 1

George Kraolides provides a good HOWTO on the subject of Root-on-LVM-on-RAID. In the following I describe my variation on this HOWTO.

The new kernel now has RAID-1 capabilities built in but I'm still running from my temporary installation on /dev/hda3. Now I want to combine /dev/hda1 and /dev/hdc1 into /dev/md/0 and /dev/hda4 and /dev/hdc4 into /dev/md/1. As the new kernel already does devfs, I use the full names and not the links, i.e. /dev/ide/host0/bus0/target0/lun0/part1 for /dev/hda1, and correspondingly for the others.

The RAID configuration is defined in /etc/raidtab:

# oregon.heebs.ch
# 2002-10-11 Elmar Heeb 

# -----
# /boot
# -----
raiddev /dev/md/0
    raid-level                1
    nr-raid-disks             2
    nr-spare-disks            0
    persistent-superblock     1
    device                    /dev/ide/host0/bus0/target0/lun0/part1
    raid-disk                 0
    device                    /dev/ide/host0/bus1/target0/lun0/part1
    raid-disk                 1

# ----------------
# LVM volume group
# ----------------
raiddev /dev/md/1
    raid-level                1
    nr-raid-disks             2
    nr-spare-disks            0
    persistent-superblock     1
    device                    /dev/ide/host0/bus0/target0/lun0/part4
    raid-disk                 0
    device                    /dev/ide/host0/bus1/target0/lun0/part4
    raid-disk                 1

I need to tell the system of the existence of the new RAID array and start them
mkraid /dev/md/0
mkraid /dev/md/1
This initializes the RAID array with the appropriate signature so that from now on the pairs are automatically assembled by the kernel at boot time (the fd partition type tells the kernel where to look for RAID arrays and mkraid ... writes the necessary information to tell it what to do with them).

The new RAID arrays can be used immediately even though they are not synchronized yet. Using cat /proc/mdstat we can see how far the synchronization got. This is also the place to look for the general state of the arrays.

On /dev/md/0 I create a ext3 file system:
mke2fs -j /dev/md/0
This will be used for /boot

Next I continue with LVM.