Richmond composed on 2025-11-09 20:28 (UTC):

> This problem reared its ugly head again. I decided, using Debian 12, to
> add in the swap space used by Debian 13 temporarily. After I had
> finished I recreated the swap space from debian 13 and updated the swap
> in fstab and resume in /etc/initramfs-tools/conf.d/resume,
> update-initramfs -u, on Debian 13. But they did not take effect because
> I was using grub from Debian 12. So I re-installed grub from Debian 13,
> and the changes took effect, but that meant I was using the wrong grub.

> This is a solution of sorts: to add a 40_custom entry to both systems:

> menuentry "Boot Debian 12 GRUB" {
>     search --set=root --fs-uuid b1edc363-c5a4-4a37-ac23-6fd31ad5d1a8
>     configfile ($root)/boot/grub/grub.cfg
> }

> menuentry "Boot Debian 13 GRUB" {
>     search --set=root --fs-uuid 7d5ab11e-e07b-4456-b31c-b13c1e0b7a8d
>     configfile ($root)/boot/grub/grub.cfg
> }

> This allows either grub to boot the other grub. But it makes me wonder
> why grub isn't independent of the OS which installed it? Particularly
> sudo update-initramfs -u won't have any effect if the OS is booted from
> a different OS's grub.

A running OS doesn't track which bootloader started it.

Examine /etc/default/grub for value of GRUB_DISTRIBUTOR=. If 12 matches 13, and
you are UEFI booting, there is a fix. If you are not UEFI booting, they are by
default going to install to the same exact place on disk, thus usurping each 
other
with each normal grub update.

With UEFI, you can mismatch those values to keep them from usurping each other.
The resulting value there, whether by script or any string value you please to
within "" place there, e.g. "debian13", determines the name of the directory on
the ESP partition from which they boot, both of which by default use directory
debian via script. You'll still need to use the UEFI BIOS BBS hotkey, or use 
BIOS
setup to change the default, or use efibootmgr to change priority prior to
shutdown or reboot, any time you wish to boot using a different bootloader than
the last used.
-- 
Evolution as taught in public schools is, like religion,
        based on faith, not based on science.

 Team OS/2 ** Reg. Linux User #211409 ** a11y rocks!

Felix Miata

Reply via email to