Install dual linux (2 distros) with GRUB & BTRFS

Hi,

i would like to install two different linux distros, yet i have some interrogations. I have no issue with linux/windows dual booting thouhg, but now it’s different.

How things are going with grub ? Which grub (/boot partition) would be the active one ? I don’t get the point.

If we say that /boot partition of distroA is the active one. If a reboot to distroB and update the kernel therefore grub (with possibly several btrfs snapshots), how grub of distroA is aware of that ?

Does anybody know the underlying mechanisms ?
Thanks

If you use default settings usually the distro that is last installed is active.

It isn’t aware.
In Linux+Linux dualboot scenarios I disable os-prober at all distros and add configfile boot entries to the “master” GRUB. “Master” GRUB has an entry for its own distro plus configfile entries for other distros and a chainloader entry for Windows, GRUB installations of other distros manage only their distro.

1 Like

Does the “master” GRUB would be the one of the last installed distro ? Meaning the active one ?
So, do you mean that this master GRUB will be grub.cfg with additional ‘menuentries’ ? like there :
https://wiki.archlinux.org/title/GRUB#Dual-booting

On more question: if a make on modification on grub.cfg, well, if then i do a update-grub, do i will lost all modifications and revert to the one generated by the templates in /etc/grub.d ?

Myself i just disable os-prober on all except the one that i want to control the boot.

1 Like

Yes.

Yes. You don’t edit grub.cfg but modify files in /etc/grub.d instead.

So with your way will Grub show the OS, advanced Options for the OS, and the OS’s snapshots for all installed OS’s instead of just showing OS, Advanced Options for each OS installed and only Snapshots for the default OS?

1 Like

This is exactly what i am wondering too, how GRUB menuentries and submenus are organized with snapshots of both root filesystems

If my reading of this example

menuentry "configfile hd0,gpt4"  {
        insmod part_gpt
        insmod btrfs
        insmod ext2
        set root='hd0,gpt4'
        configfile /boot/grub/grub.cfg
}

from the link you posted above is correct, choosing this option from the the Grub boot menu of your main system should bring up the exact boot menu of the of the other system as if you would have launched it yourself from let’s say the Bios’ one shot boot menu. This is at least my reading.

2 Likes

I blogged about multiboot

Maybe that’s similar to what you want to achieve

1 Like

@mrvictory want to answer the question you were asked.