Success with root on LVM using the Gervai Raid and LVM hook

Terry Burton tez at terryburton.co.uk
Wed Aug 22 15:40:29 CEST 2007


Hi.

Just a quick report to say that I have successfully used the Gervai
RAID and LVM hook[1] to FAI install a bunch of new hosts with root on
LVM, using FAI as shipped with Debian Etch.

Note: I have no need for RAID but it should be easy to generalise the
following steps to work with the Root on LVM on RAID approach.

Besides installing the SW_RAID script as described by its
documentation, it was also necessary to:

* Append dm_mod to the kernelmodules in class/20-hwdetect.source, so
that the booted install system becomes LVM capable.

* Create a configuration script (included below) that that adds the
device mapper modules to /etc/initramfs-tools/modules and rebuilds the
initramfs at the end of installation. (The presence of these modules
causes update-initramfs to include the relevant libraries and binaries
for the initrd to support LVM.)

Irrespective of whether or not LVM/RAID support will be included
within vanilla FAI anytime soon, it could be immediately useful to
amend the default FAI tasklist somehow so that at a stage after
installing the packages it will check the contents of a variable, say
INITRD_MODULES, which unless empty it appends to
$target/etc/initramfs-tools/modules and invokes $ROOTCMD
update-initramfs -u. This would give you some simple control of what
lands in your initrd, avoiding the need for my fixup script.

However, I think that is would be very valuable to support Root on LVM
(on RAID) since this is a supported option by the "new" Debian
Installer and nowadays the BusyBox-based initramfs makes debugging of
boot problems much easier that with the previous system.


Hope this helps,

Tez


[1] http://faiwiki.informatik.uni-koeln.de/index.php/User:Gervai/Raid_and_LVM_hook

----

Contents of scripts/SW_RAID/10-misc:

#! /bin/bash

error=0 ; trap "error=$((error|1))" ERR

cat <<EOF >> $target/etc/initramfs-tools/modules
dm_mod
dm_mirror
dm_snapshot
EOF

$ROOTCMD update-initramfs -u

# Fix the incorrect /dev/ entry that the SW_RAID helper makes in fstab
with root on LVM
# - Obviously it would be better to fix the Gervai RAID and LVM hook
in the first place
sed -ie '/^\/dev\/ /d' /tmp/target/etc/fstab


More information about the linux-fai mailing list