1

Note. This post was originally mostly about how to chainload GRUB2 EFI bootloaders from different OS's in a LVM setup, from a grub bootloader outside of that LVM. I found a solution to this question using information from this thorough documentation on EFI bootloaders, and so I have edited this question to focus more about the other part of setting up the same process with luks-encrypted volumes.

By adding this to /etc/grub.d/40_custom in Fedora, which configures the GRUB installed on the physical partition sda2 outside of the LVM, I was able to chainload the debian GRUB which is located in the debian root LVM.

menuentry "Debian, GNU Linux" {
insmod lvm
insmod ext2
insmod part_gpt
set root='(hd0,gpt1)'  # this is my ESP partition
chainloader /efi/debian/grubx86.efi   # The debian bootloader path in ESP
}



I would like to set up a dual-/multiboot system where I combine two SSD's two one Volume Group using LVM. The tricky part is that I also want as much of the system as possible encrypted.

As far as I can tell, LVM on LUKS doesn't work with spanning the LVM over multiple disks. So I guess my option here is to set up the LVM first and then encrypt each LV individually.

The actual encryption part I think I can figure out by myself. But how do I share these encrypted drives amongar multiple distros? Especially the data-volume and the (/var/)www-volume.

My system is a laptop (Asus u500vz) with CSM which is turned off, so it is running in UEFI mode.

This is my partition scheme as of now:

/dev/sda
    |--sda1 - ESP
    |--sda2 - Boot / Grub2
    |--sda3 - PV1

/dev/sdb
    |--sdb1 - PV2

I have both these PV's in a VG called 'vg' with the following LV's

LV          VG Attr       LSize 
data        vg -wi-ao---- 100.00g                                                    
debian-home vg -wi-a-----   2.00g                                                    
debian-root vg -wi-a-----  10.00g                                                    
debian-var  vg -wi-a-----   3.00g                                                    
fedora-home vg -wi-ao----   2.00g                                                    
fedora-root vg -wi-ao----  10.00g                                                    
fedora-var  vg -wi-ao----   3.00g                                                    
opt         vg -wi-ao----   1.00g                                                    
swap        vg -wi-ao----  16.00g                                                    
usr-local   vg -wi-ao----  15.00g                                                    
www         vg -wi-ao----   5.00g

Both OS's share all of these LV's except home, root and var. In the future I might add arch or some other distro to this using som extra unallocated space.

How would I set up the bootloaders in the most optimal way for flexibility? I was thinking of unmounting the sda2 partition from fedora and install GRUB locally like I have for debian. So that basically I would have one GRUB from the ESP + sda2 partition to chainload each GRUB for debian and fedora.

But I am not sure I actually need the sda2/Boot partition. Could I set it up so that grub is installed only in the ESP and then chainload the others from there?

Any help on this would be greatly appreciated. If you need additional information I'll do my best to provide it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.