Hello,
I have a machine with a dual fedora boot on 2 drives (with grub2) I daily maintain one (say A on /dev/sda4), and occasionally the other one (say B on /dev/sdc5). The problem is when I update B, grub is not update properly, i.e., I cannot boot on B with the new kernel. Hence, I run grub2-mkconfig -o /boot/grub2/grub.cfg on both machines But it is not enough I tried grub2-install /dev/sda But I get Installing for x86_64-efi platform. grub2-install: error: This utility should not be used for EFI platforms because it does not support UEFI Secure Boot. If you really wish to proceed, invoke the --force option. Make sure Secure Boot is disabled before proceeding.
What is the correct procedure?
dnf reinstall shim-* grub2-*
Thank
=========================================================================== Patrick DUPRÉ | | email: pdupre@gmx.com ===========================================================================
Patrick Dupre composed on 2025-03-23 09:46 (UTC+0100):
I have a machine with a dual fedora boot on 2 drives (with grub2) I daily maintain one (say A on /dev/sda4), and occasionally the other one (say B on /dev/sdc5). The problem is when I update B, grub is not update properly, i.e., I cannot boot on B with the new kernel. Hence, I run grub2-mkconfig -o /boot/grub2/grub.cfg on both machines But it is not enough I tried grub2-install /dev/sda But I get Installing for x86_64-efi platform. grub2-install: error: This utility should not be used for EFI platforms because it does not support UEFI Secure Boot. If you really wish to proceed, invoke the --force option. Make sure Secure Boot is disabled before proceeding.
What is the correct procedure?
dnf reinstall shim-* grub2-*
Simplest: remove Grub from B, or disable Grub on B. Only one Grub per PC is needed. After each new kernel is installed to B, update Grub on A with os-prober enabled and with GRUB_DISABLE_SUBMENU="y" in /etc/default/grub. Even that frequent Grub maintenance effort isn't needed if you configure your Grub to boot using kernel and initrd symlinks instead of specific kernel and symlink versions.
I don't have any dual boot PCs. Mine are all multiboot, 10 or more GNU/Linux installations per PC on most. Fewest has 4. 2 have more than 40 each.
On 3/23/25 7:36 AM, Felix Miata wrote:
Simplest: remove Grub from B, or disable Grub on B. Only one Grub per PC is needed. After each new kernel is installed to B, update Grub on A with os-prober enabled and with GRUB_DISABLE_SUBMENU="y" in /etc/default/grub. Even that frequent Grub maintenance effort isn't needed if you configure your Grub to boot using kernel and initrd symlinks instead of specific kernel and symlink versions.
I don't have any dual boot PCs. Mine are all multiboot, 10 or more GNU/Linux installations per PC on most. Fewest has 4. 2 have more than 40 each.
Felix
Could you give an example?
Robert McBroom composed on 2025-03-27 00:02 (UTC-0400):
Felix Miata wrote:
Simplest: remove Grub from B, or disable Grub on B. Only one Grub per PC is needed. After each new kernel is installed to B, update Grub on A with os-prober enabled and with GRUB_DISABLE_SUBMENU="y" in /etc/default/grub. Even that frequent Grub maintenance effort isn't needed if you configure your Grub to boot using kernel and initrd symlinks instead of specific kernel and symlink versions.
I don't have any dual boot PCs. Mine are all multiboot, 10 or more GNU/Linux installations per PC on most. Fewest has 4. 2 have more than 40 each.
Could you give an example?
Example of what exactly?
# grep menuentry /boot/grub2/custom.cfg | wc -l 31 # grep -A6 dora /boot/grub2/custom.cfg menuentry "Fedora 42 defkernel on P22" { load_video set gfxpayload=keep search --no-floppy --set=root --hint-baremetal=ahci0,gpt22 --label <filter> linux /boot/vmlinuz root=LABEL=<filter> noresume audit=0 ipv6.disable=1 net.ifnames=0 consoleblank=0 preempt=full mitigations=off video=1440x900@60 initrd /boot/initrd } -- menuentry "Fedora 41 defkernel 3 on P25" { load_video set gfxpayload=keep search --no-floppy --set=root --hint-baremetal=ahci0,gpt25 --label <filter> linux /boot/vmlinuz root=LABEL=<filter> noresume audit=0 ipv6.disable=1 net.ifnames=0 consoleblank=0 preempt=full mitigations=off video=1440x900@60 3 initrd /boot/initrd } -- menuentry "Fedora 39 defkernel 3 on P15" { load_video set gfxpayload=keep search --no-floppy --set=root --hint-baremetal=ahci0,gpt15 --label <filter> linux /boot/vmlinuz root=LABEL=<filter> noresume audit=0 ipv6.disable=1 net.ifnames=0 consoleblank=0 preempt=full mitigations=off video=1440x900@60 3 initrd /boot/initrd } -- menuentry "Fedora 40 defkernel 3 on P18" { load_video set gfxpayload=keep search --no-floppy --set=root --hint-baremetal=ahci0,gpt18 --label <filter> linux /boot/vmlinuz root=LABEL=<filter> noresume audit=0 ipv6.disable=1 net.ifnames=0 consoleblank=0 preempt=full mitigations=off video=1440x900@60 3 initrd /boot/initrd } -- menuentry "Fedora 42 oldkernel 3 on P22" { load_video set gfxpayload=keep search --no-floppy --set=root --hint-baremetal=ahci0,gpt22 --label <filter> linux /boot/vmlinuz-old root=LABEL=<filter> noresume audit=0 ipv6.disable=1 net.ifnames=0 consoleblank=0 preempt=full mitigations=off video=1440x900@60 3 initrd /boot/initrd-old } -- menuentry "Fedora 42 test kernel 3 on P22" { load_video set gfxpayload=keep search --no-floppy --set=root --hint-baremetal=ahci0,gpt22 --label <filter> linux /boot/vmlinuz-tst root=LABEL=<filter> noresume audit=0 ipv6.disable=1 net.ifnames=0 consoleblank=0 preempt=full mitigations=off video=1440x900@60 3 initrd /boot/initrd-tst } # fdisk -l /dev/nvme0n1 | grep nux | wc -l 26 # ls -gGh /disks/f39/boot/initrd-* lrwxrwxrwx 1 36 Dec 30 17:22 /disks/f39/boot/initrd-cur -> initramfs-6.11.9-100.fc39.x86_64.img lrwxrwxrwx 1 37 Oct 30 23:22 /disks/f39/boot/initrd-old -> initramfs-6.10.13-100.fc39.x86_64.img lrwxrwxrwx 1 36 Aug 12 2024 /disks/f39/boot/initrd-old2 -> initramfs-6.9.12-100.fc39.x86_64.img # ls -gGh /etc/grub.d/*cust* -rwxr-xr-x 1 216 Feb 11 2017 /etc/grub.d/07_custom -rwxr-xr-x 1 0 Aug 9 2018 /etc/grub.d/40_custom -rwxr-xr-x 1 0 Aug 9 2018 /etc/grub.d/41_custom # Because of 07_custom, which is merely a copy of the OEM/upstream 41_custom, the Grub bootloader displays the stanzas from custom.cfg first in the boot menu presented, followed by those from auto-generated entries in grub.cfg.
40_custom or a copy of it renamed could be used as initial template instead, to contain the custom stanzas instead of using a custom.cfg file (AIUI).
see also: https://forums.opensuse.org/t/how-to-have-a-custom-uefi-grub-menu-for-a-multiboot-system/133541
On 3/27/25 12:37 AM, Felix Miata wrote:
Robert McBroom composed on 2025-03-27 00:02 (UTC-0400):
Felix Miata wrote:
Simplest: remove Grub from B, or disable Grub on B. Only one Grub per PC is needed. After each new kernel is installed to B, update Grub on A with os-prober enabled and with GRUB_DISABLE_SUBMENU="y" in /etc/default/grub. Even that frequent Grub maintenance effort isn't needed if you configure your Grub to boot using kernel and initrd symlinks instead of specific kernel and symlink versions. I don't have any dual boot PCs. Mine are all multiboot, 10 or more GNU/Linux installations per PC on most. Fewest has 4. 2 have more than 40 each.
Could you give an example?
Example of what exactly?
# grep menuentry /boot/grub2/custom.cfg | wc -l 31 # grep -A6 dora /boot/grub2/custom.cfg menuentry "Fedora 42 defkernel on P22" { load_video set gfxpayload=keep search --no-floppy --set=root --hint-baremetal=ahci0,gpt22 --label <filter> linux /boot/vmlinuz root=LABEL=<filter> noresume audit=0 ipv6.disable=1 net.ifnames=0 consoleblank=0 preempt=full mitigations=off video=1440x900@60 initrd /boot/initrd } -- menuentry "Fedora 41 defkernel 3 on P25" { load_video set gfxpayload=keep search --no-floppy --set=root --hint-baremetal=ahci0,gpt25 --label <filter> linux /boot/vmlinuz root=LABEL=<filter> noresume audit=0 ipv6.disable=1 net.ifnames=0 consoleblank=0 preempt=full mitigations=off video=1440x900@60 3 initrd /boot/initrd } -- menuentry "Fedora 39 defkernel 3 on P15" { load_video set gfxpayload=keep search --no-floppy --set=root --hint-baremetal=ahci0,gpt15 --label <filter> linux /boot/vmlinuz root=LABEL=<filter> noresume audit=0 ipv6.disable=1 net.ifnames=0 consoleblank=0 preempt=full mitigations=off video=1440x900@60 3 initrd /boot/initrd } -- menuentry "Fedora 40 defkernel 3 on P18" { load_video set gfxpayload=keep search --no-floppy --set=root --hint-baremetal=ahci0,gpt18 --label <filter> linux /boot/vmlinuz root=LABEL=<filter> noresume audit=0 ipv6.disable=1 net.ifnames=0 consoleblank=0 preempt=full mitigations=off video=1440x900@60 3 initrd /boot/initrd } -- menuentry "Fedora 42 oldkernel 3 on P22" { load_video set gfxpayload=keep search --no-floppy --set=root --hint-baremetal=ahci0,gpt22 --label <filter> linux /boot/vmlinuz-old root=LABEL=<filter> noresume audit=0 ipv6.disable=1 net.ifnames=0 consoleblank=0 preempt=full mitigations=off video=1440x900@60 3Re: initrd /boot/initrd-old } -- menuentry "Fedora 42 test kernel 3 on P22" { load_video set gfxpayload=keep search --no-floppy --set=root --hint-baremetal=ahci0,gpt22 --label <filter> linux /boot/vmlinuz-tst root=LABEL=<filter> noresume audit=0 ipv6.disable=1 net.ifnames=0 consoleblank=0 preempt=full mitigations=off video=1440x900@60 3 initrd /boot/initrd-tst } # fdisk -l /dev/nvme0n1 | grep nux | wc -l 26 # ls -gGh /disks/f39/boot/initrd-* lrwxrwxrwx 1 36 Dec 30 17:22 /disks/f39/boot/initrd-cur -> initramfs-6.11.9-100.fc39.x86_64.img lrwxrwxrwx 1 37 Oct 30 23:22 /disks/f39/boot/initrd-old -> initramfs-6.10.13-100.fc39.x86_64.img lrwxrwxrwx 1 36 Aug 12 2024 /disks/f39/boot/initrd-old2 -> initramfs-6.9.12-100.fc39.x86_64.img # ls -gGh /etc/grub.d/*cust* menuentry "Fedora 40 defkernel 3 on P18" { load_video set gfxpayload=keep search --no-floppy --set=root --hint-baremetal=ahci0,gpt18 --label <filter> linux /boot/vmlinuz root=LABEL=<filter> noresume audit=0 ipv6.disable=1 net.ifnames=0 consoleblank=0 preempt=full mitigations=off video=1440x900@60 3 initrd /boot/initrd }
-rwxr-xr-x 1 216 Feb 11 2017 /etc/grub.d/07_custom -rwxr-xr-x 1 0 Aug 9 2018 /etc/grub.d/40_custom -rwxr-xr-x 1 0 Aug 9 2018 /etc/grub.d/41_custom # Because of 07_custom, which is merely a copy of the OEM/upstream 41_custom, the Grub bootloader displays the stanzas from custom.cfg first in the bootmenuentry "Fedora 40 defkernel 3 on P18" { load_video set gfxpayload=keep search --no-floppy --set=root --hint-baremetal=ahci0,gpt18 --label <filter> linux /boot/vmlinuz root=LABEL=<filter> noresume audit=0 ipv6.disable=1 net.ifnames=0 consoleblank=0 preempt=full mitigations=off video=1440x900@60 3 initrd /boot/initrd } -- menuentry "Fedora 40 defkernel 3 on P18" { load_video set gfxpayload=keep search --no-floppy --set=root --hint-baremetal=ahci0,gpt18 --label <filter> linux /boot/vmlinuz root=LABEL=<filter> noresume audit=0 ipv6.disable=1 net.ifnames=0 consoleblank=0 preempt=full mitigations=off video=1440x900@60 3 initrd /boot/initrd }
menu presented, followed by those from auto-generated entries in grub.cfg.
40_custom or a copy of it renamed could be used as initial template instead, to contain the custom stanzas instead of using a custom.cfg file (AIUI).
see also: https://forums.opensuse.org/t/how-to-have-a-custom-uefi-grub-menu-for-a-multiboot-system/133541
There is much hidden. Symlinks don't track to the changes that an update does to /boot
menuentry "Fedora 40 defkernel 3 on P18" { load_video set gfxpayload=keep search --no-floppy --set=root --hint-baremetal=ahci0,gpt18 --label <filter> linux /boot/vmlinuz root=LABEL=<filter> noresume audit=0 ipv6.disable=1 net.ifnames=0 consoleblank=0 preempt=full mitigations=off video=1440x900@60 3 initrd /boot/initrd } --
What activity goes on in <filter>? Something picks up the names on the new kernel in an update. You are naming the partitions by labels in your own scheme which can be understood and mapped to your custom.cfg.
Something then has to pick up the /boot/initramfs... of a new upgrade and cycle it into the rotation in the storage space of
/disks/f39/boot/...
Can see how all can be done with extensive editing but not easily.
Robert McBroom composed on 2025-03-28 22:48 (UTC-0400):
Felix Miata wrote:
...
menuentry "Fedora 40 defkernel 3 on P18" { load_video set gfxpayload=keep search --no-floppy --set=root --hint-baremetal=ahci0,gpt18 --label <filter> linux /boot/vmlinuz root=LABEL=<filter> noresume audit=0 ipv6.disable=1 net.ifnames=0 consoleblank=0 preempt=full mitigations=off video=1440x900@60 3 initrd /boot/initrd }
menu presented, followed by those from auto-generated entries in grub.cfg.
40_custom or a copy of it renamed could be used as initial template instead, to contain the custom stanzas instead of using a custom.cfg file (AIUI).
see also: https://forums.opensuse.org/t/how-to-have-a-custom-uefi-grub-menu-for-a-multiboot-system/133541
There is much hidden. Symlinks don't track to the changes that an update does to /boot
Hidden from what? Track what? The symlinks live in /boot/. For distros that don't automatically create them, like Fedora, it's the admin's job to see to their creation.
menuentry "Fedora 40 defkernel 3 on P18" { load_video set gfxpayload=keep search --no-floppy --set=root --hint-baremetal=ahci0,gpt18 --label <filter> linux /boot/vmlinuz root=LABEL=<filter> noresume audit=0 ipv6.disable=1 net.ifnames=0 consoleblank=0 preempt=full mitigations=off video=1440x900@60 3 initrd /boot/initrd }
What activity goes on in <filter>?
<filter> is a placeholder/sustitute for information that needn't be shared on a mailing list or forever archived on the WWW. LABELs are filesystem labels, unique strings determined by an admin, which an admin can determine, and more easily manage than 36 character UUIDs.
Something picks up the names on the new kernel in an update.
Depends on whether distro normally creates kernel/initrd symlinks as a matter of course. When it does, there's "no picking up" to do. Debian and various of its derivatives create them in the boot filesystem's /; openSUSE and Mageia e.g. create them in /boot/.
You are naming the partitions by labels in your own scheme which can be understood and mapped to your custom.cfg.
Every admin has that opportunity. Your point?
Something then has to pick up the /boot/initramfs... of a new upgrade and cycle it into the rotation in the storage space of /disks/f39/boot/...
???
The example is from a real multiboot system with non-booted installations' / filesystems mounted or not in /disks/*. There's nothing to be attended to in the out of support F39 example's filesystem.
Can see how all can be done with extensive editing but not easily.
No custom.cfg or 07_custom editing is indicated except when a new distro is added or an old one removed or renamed. The only normally required activity is when new kernel is installed and the distro does not automatically create kernel and initrd symlinks, or a newly installed kernel fails, admin removes it, and the prior one didn't/doesn't have its own, requiring minor retro activity. Here, the last symlink creation is in root's bash history, so trivial to run against latest kernel, after renaming or deleting the prior symlink pair (e.g. mv /boot/vmlinuz /boot/vmlinuzp && mv /boot/initrd /boot/initrdp):
cd /boot ln -s /initramfs-6...<tab> /initrd && ln -s /vmlinuz-6...<tab> /vmlinuz
Booting a prior kernel based upon the e.g. above would simply be either by striking the E key at the Grub menu's normal stanza for that distro and appending a p in two places, or, selecting an alternate stanza that already includes those p's, or whatever other suffix admin has determined appropriate.
On 3/29/25 12:01 AM, Felix Miata wrote:
Robert McBroom composed on 2025-03-28 22:48 (UTC-0400):
Felix Miata wrote:
...
menuentry "Fedora 40 defkernel 3 on P18" { load_video set gfxpayload=keep search --no-floppy --set=root --hint-baremetal=ahci0,gpt18 --label <filter> linux /boot/vmlinuz root=LABEL=<filter> noresume audit=0 ipv6.disable=1 net.ifnames=0 consoleblank=0 preempt=full mitigations=off video=1440x900@60 3 initrd /boot/initrd } menu presented, followed by those from auto-generated entries in grub.cfg. 40_custom or a copy of it renamed could be used as initial template instead, to contain the custom stanzas instead of using a custom.cfg file (AIUI). see also: https://forums.opensuse.org/t/how-to-have-a-custom-uefi-grub-menu-for-a-multiboot-system/133541
There is much hidden. Symlinks don't track to the changes that an update does to /boot
Hidden from what? Track what? The symlinks live in /boot/. For distros that don't automatically create them, like Fedora, it's the admin's job to see to their creation.
My initial understanding was that they would follow updating the kernel. Simple enough to do the manual step.
menuentry "Fedora 40 defkernel 3 on P18" { load_video set gfxpayload=keep search --no-floppy --set=root --hint-baremetal=ahci0,gpt18 --label <filter> linux /boot/vmlinuz root=LABEL=<filter> noresume audit=0 ipv6.disable=1 net.ifnames=0 consoleblank=0 preempt=full mitigations=off video=1440x900@60 3 initrd /boot/initrd }
What activity goes on in <filter>?
Didn't understand that <filter> was just the partition label.
<filter> is a placeholder/sustitute for information that needn't be shared on a mailing list or forever archived on the WWW. LABELs are filesystem labels, unique strings determined by an admin, which an admin can determine, and more easily manage than 36 character UUIDs.
The /dev/xxxx form of a label still works very well. Then complication enter with fedora and btrfs or lvm
Something picks up the names on the new kernel in an update.
Depends on whether distro normally creates kernel/initrd symlinks as a matter of course. When it does, there's "no picking up" to do. Debian and various of its derivatives create them in the boot filesystem's /; openSUSE and Mageia e.g. create them in /boot/.
Looked at Debian and Suse in virtual machines to see how they were using the symlinks. While they created the symlink entries they used the explicit /boot entries in the boots.
You are naming the partitions by labels in your own scheme which can be understood and mapped to your custom.cfg.
Every admin has that opportunity. Your point?
Just that it is understood.
Something then has to pick up the /boot/initramfs... of a new upgrade and cycle it into the rotation in the storage space of /disks/f39/boot/...
The example is from a real multiboot system with non-booted installations' / filesystems mounted or not in /disks/*. There's nothing to be attended to in the out of support F39 example's filesystem.
Can see how all can be done with extensive editing but not easily.
No custom.cfg or 07_custom editing is indicated except when a new distro is added or an old one removed or renamed. The only normally required activity is when new???
kernel is installed and the distro does not automatically create kernel and initrd symlinks, or a newly installed kernel fails, admin removes it, and the prior one didn't/doesn't have its own, requiring minor retro activity. Here, the last symlink creation is in root's bash history, so trivial to run against latest kernel, after renaming or deleting the prior symlink pair (e.g. mv /boot/vmlinuz /boot/vmlinuzp && mv /boot/initrd /boot/initrdp):
cd /boot ln -s /initramfs-6...<tab> /initrd && ln -s /vmlinuz-6...<tab> /vmlinuz
emacs dired in edit mode makes the updating of the /initramfs and /vimlinuz symlink entries very easy.
Booting a prior kernel based upon the e.g. above would simply be either by striking the E key at the Grub menu's normal stanza for that distro and appending a p in two places, or, selecting an alternate stanza that already includes those p's, or whatever other suffix admin has determined appropriate.
agreed
On 3/23/25 4:46 AM, Patrick Dupre via users wrote:
Hello,
I have a machine with a dual fedora boot on 2 drives (with grub2) I daily maintain one (say A on /dev/sda4), and occasionally the other one (say B on /dev/sdc5). The problem is when I update B, grub is not update properly, i.e., I cannot boot on B with the new kernel. Hence, I run grub2-mkconfig -o /boot/grub2/grub.cfg on both machines But it is not enough I tried grub2-install /dev/sda But I get Installing for x86_64-efi platform. grub2-install: error: This utility should not be used for EFI platforms because it does not support UEFI Secure Boot. If you really wish to proceed, invoke the --force option. Make sure Secure Boot is disabled before proceeding.
What is the correct procedure?
dnf reinstall shim-* grub2-*
Thank
You can do this by keeping the boot and root partitions completely separate and using the bios boot to switch between them. Otherwise you have to use different kernels to the two installations and have the entries in
/boot/loader/entries
apply the proper uuids