Chainloading Grub2 on Linode with LUKS + LVM

Yesterday I decided I would try out chainloading grub2 from linode’s pv-grub after reading https://notes.pault.ag/linode-pv-grub-chainning/.

Even though I had successfully built the shim using the instructions, upon booting with a generated config I ran into issues with grub2 not knowing how to deal with my LUKS+LVM disk images.

After more searching, I came across a guide on http://blog.cyplo.net/2013/11/10/booting-gentoo-lukslvm2systemd/ which dealt with setting up grub2 to work with an identical root setup to my own.

The relevant part of the guide was the grub config,

nimbus ~ # cat /etc/default/grub
GRUB_DISTRIBUTOR="Gentoo"
GRUB_PRELOAD_MODULES=lvm
GRUB_CRYPTODISK_ENABLE=y
GRUB_DEVICE=/dev/ram0
GRUB_CMDLINE_LINUX="real_root=/dev/mapper/Nimbus-root crypt_root=/dev/xvdb dolvm rootfstype=btrfs rootflags=compress=lzo"
GRUB_DISABLE_LINUX_UUID=true
GRUB_DISABLE_RECOVERY=true

After setting the config up and generating a new config file, i was thrown into the familiar passphrase prompt on the next boot without any errors! (Huzzah!)

Leave a Reply