Finnix on PV-GRUB

Finnix, the LiveCD for system administrators
Jump to navigation Jump to search

Arbitrary Finnix builds can be booted in Xen via PV-GRUB. For example, this method is used to test Finnix on Linode before release.


Create a guest with two disk images:

  • xvda - Stub boot disk for PV-GRUB, ext2 (or ext3; optional).
  • xvdb - The Finnix ISO itself.

Create the filesystem on xvda, and write the Finnix ISO to xvdb:

# mkfs.ext2 /dev/xvda
# dd if=finnix.iso of=/dev/xvdb

Mount xvda and create /boot/grub/menu.lst on it with the following contents:

default 0
timeout 15

title           Finnix
kernel          (hd1)/boot/x86/linux64 quiet
initrd          (hd1)/boot/x86/initrd.xz

That's it, just boot! PV-GRUB will find /boot/grub/menu.list on the first available disk and load it. "(hd1)" will map to the second, the Finnix ISO9660 filesystem with the kernel and initrd.

Remember, paravirt functionality is only available in the 64-bit Finnix kernel, so be sure to use a 64-bit PV-GRUB.

Linode-specific notes

Use the pv-grub-x86_64 Linode kernel.

Disable Lassie to prevent rebooting the system after you have powered it down.

Disable all "Filesystem/Boot Helpers" on the profile.

To facilitate writing the ISO, create an additional Finnix profile with the Linode system-wide Finnix installation (I called this "Finnix Linode"):

  • Kernel: "Recovery - Finnix (kernel)" (Linode system-wide)
  • Initrd: "Recovery - Finnix (initrd)" (Linode system-wide)
  • /dev/xvda: PV-GRUB stub boot disk (ext3, can be as small as 32MB)
  • /dev/xvdb: Finnix ISO to write (raw, at least the size of the Finnix ISO, 256MB should be fine)
  • /dev/xvdh: "Recovery - Finnix (iso)" (Linode system-wide)
  • Root device: /dev/xvdh
  • All "Filesystem/Boot Helpers" disabled

Use this profile to write the PV-GRUB Finnix ISO to xvdb. This must be done even after you have a working PV-GRUB Finnix profile, since the disk will be in active use.

When copying multiple times, I boot into the "Finnix Linode" profile, mount /media/xvda, and use the following helper script at /media/xvda/ to set a password, start sshd, wait for the copy, and write the ISO:


set -e

IP="<Linode IP here>"

if ! [ -f /media/xvda/ ]; then
  echo "Please mount this under /media/xvda"
  exit 1

if [ -z "$ISO" ]; then
  echo "Usage: $0 finnix.iso"
  exit 1

passwd root
/etc/init.d/ssh start
echo "rsync -avzP -e 'ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' $ISO root@$IP:/media/xvda/"
echo "Press enter when done"
read readwait

dd if=/media/xvda/$ISO of=/dev/xvdb
sync; sync