Decided to stop trying to setup dual booting with os-prober and went for chainloader instead

Hello. A little bit unusual, but this one is an answer, not a question.

I just installed opensuse tumbleweed in my PC again after a while, but, since the main system is Debian, I decided to ditch opensuse’s own bootloader and went through the os-prober-from-Debian route instead. Except that now, instead of switching to ext4 as before, I decided to leave btrfs as the default (which means the installer creates a multi-volume btrfs partition).

os-prober successfully detected opensuse and added an entry to Debian’s grub.

It didn’t boot. Something related to not finding the default snapshot that Debian didn’t know about, I think.

After failing to find any answers regarding how to solve this problem in Debian’s grub installation, I decided to bypass it and just go directly to opensuse’ grub, no questions asked:

# /etc/grub.d/40_custom
menuentry 'openSUSE (chainloader)' --class opensuse --class gnu-linux --class gnu --class os {
    insmod chain     # enable chainloader
    insmod btrfs     # enable btrfs
    insmod part_gpt  # enable gpt partitions (must come after `insmod btrfs`)
    set root=(hd2,gpt1)
    chainloader +1
}

(To find the root, I recommend opening a command prompt from grub and ls-ing the partitions to find the one you want)

Not only this solved the multivolume btrfs issue, but this also means I don’t need to worry about updating grub from inside Debian everytime I upgrade opensuse’s kernel like I had to before. I leave it to opensuse to decide how to best setup its own boot.

Considering I was also planning on installing other operating systems alongside Debian and opensuse, this solution is very reassuring and honestly I think it should be the default instead of having a foreign operating system try and figure out how to boot the system.

Some other multiboot alternatives are discussed @How to have a custom UEFI grub menu for a multiboot system.

1 Like

It is not needed for legacy chainloading.

I couldn’t find the partitions of the disk where opensuse was installed without that

I have no idea what you mean. There is no search statement in this menu entry. The partition is hardcoded.

While on the GRUB console, the partitions of (hd2) simply wouldn’t appear (e.g. via ls) if I didn’t insmod btrfs then insmod part_gpt. Setting the root to (hd2,gpt1) would not would if I didn’t do that.