LVM, RAID and GRUB on my (home) mailserver (part 3)

Now with a newly compiled Kernel with support for an initial RAM disk and an initial RAM disk both on my /boot partition I was ready to rock-and-roll.
Except that when I rebooted I got the message:

/dev/console file does not exist

After much examination of the initial RAM disk:

  • it does have /dev/console
  • the script which runs is /sbin/init
  • you can pass it the argument ‘lvm2rescue’ to get a bash prompt inside the initial RAM disk as busybox is installed

The answer came to me after a night’s sleep. The penultimate line in the /sbin/init script uses pivot_root to switch the system root from the RAM disk to the hard drive. Then chroot used to run the real /sbin/init process which starts the system. It is this system where /dev/console needs to exist for the script to run successfully.
So back inside the rescue environment I reload the RAID and VolumeGroups (see prior post):

cd /mnt/gentoo/dev
MAKEDEV console

And that was it. A simple reboot of the system and it was up and running.
Now, with a fully functioning system, I could set about completing the RAID setup. After partitioning the disk with fdisk:

mdadm /dev/md0 -a /dev/hdc1
mdadm /dev/md1 -a /dev/hdc2

And don’t forget to write GRUB to the second hard drive as well:

grub
root (hd0,0)
setup (hd0)
root (hd1,0)
setup (hd1)
quit

Now to let the RAID build (cat /proc/mdstat estimates 5 hours).