Monday, October 12, 2009

Booting to a raid volume using jfs

While upgrading an older debian server, I had to make some modifications to get the kernel booting. This shouldn't normally be necessary, but for some reason the hardware was not getting auto detected. I'm almost 100% sure I messed up some other step in order to require this. The system's root drive is raid1 and uses jfs. The following changes were done:

Added: /etc/initramfs-tools/modules:
jfs
raid1
md

Created:
/etc/initramfs-tools/scripts/local-top/probes
#!/bin/sh
modprobe raid1
modprobe md
modprobe jfs

mknod /dev/md2 b 9 2
mknod /dev/md0 b 9 0
mknod /dev/md1 b 9 1
mdadm --assemble --scan

The above script must be chmod +x'd. I copied to it /etc/initramfs-tools/scripts/local-top/probe/local-premount/ just to make sure it ran.

Modified /usr/sbin/mkinitramfs in the #modutils section:
copy_exec /sbin/mdadm /sbin
copy_exec /sbin/fsck.jfs /sbin
mkdir -p "${DESTDIR}/etc/mdadm"
cp -a /etc/mdadm/mdadm.conf "${DESTDIR}/etc/mdadm/"

The above changes were done by booting into the rescue mode of a debian installer and mounting.

No comments: