Multi-boot With Grub

Shoulda Known

So... I should have known this would come back to bite me. I avoided using the Grub bootloader for a long time because it's kinda complex and I was worried about having to fix it. Well it was easy to setup and get working initially but after an update or something it broke. I boot multiple Linux OS's and the non-primary OS's wouldn't boot. So I decided I was going to need to roll up my sleeves and figure this out.

Arch Wiki Saves The Day

I took my time and read the Arch Wiki guide on Grub particularly the dual booting section. I found some info that I wish I had known about years ago. If you have another install that has Grub installed you can create and entry that will point to that install and use it's grub.cfg file. I suspect this is going to save me a ton of trouble. I won't have to worry about things breaking because an update happens on one system. Here is the entry that I used in the custom grub entry on the primary system.

menuentry "Arch Linux"  {
        insmod part_gpt
        insmod lvm
        insmod ext2
        set root='lvmid/fIWcMg-BJ40-6sxU-l5fX-Qvlv-Las3-vu34pb/0gHBsE-jYEx-Y5Vh-5eE3-MVLk-DAkA-ckqGPQ'
        configfile /boot/grub/grub.cfg
}   
  • part_gpt is needed since my disk uses the GPT partitioning scheme.
  • lvm since the root file system is on LVM.
  • ext2 because the file system is ext4 (from what I can tell ext2 covers ext2/3/4).
  • root use the UUID of the LVM volume group AND the logical volume.
  • configfile points to the grub.cfg of the system we want to boot.

This entry goes into /etc/grub.d/40_custom. Then when the entry is selected at boot grub reloads it's config from that entry instead of the one on the primary OS's partition and you can boot from it.

Moving Forward

I have been looking for a clean way to multi-boot with LVM for a while now. I think this is the way moving forward. Hopefully once these custom entries are created the work will be done. I don't love having Grub installed on multiple OS's and not using it, and I am still not sure what will happen when they are trying to install updates and update the UEFI boot settings. But so far that doesn't seem to be an issue.