Anomalous Grub2 update behavior on triple boot system, with Fedora 32 Jam dominant system

I have a triple boot system, where I have only been using Fedora until yesterday. The other installs are Ubuntu Studio 20.04 and Win 10. The problem has to do with the way my install of Fedora 32 Jam behaves when updating the system with new kernels. When first installed, Fedora 32 Jam Grub2 recognized the other OS’s on my computer. After having gone through a couple of kernel updates, I discovered that Grub2 can no longer find Win 10 or Ubuntu Studio. I have not used the other OS’s since installing Fedora, so nothing has changed on those systems. This is solely a Fedora issue. I assume therre is a script that should be scanning for other OS’s after a kernel update. Help would be appreciated to sort this out. I am a completely new Fedora user. I have been using Fedora for almost two weeks.

So, you can try fixing this manually:

  1. Install os-prober if it is not already installed:
    $ sudo dnf install os-prober

  2. Manually run os-prober and grub2-mkconfig command to generate a fresh grub.cfg:
    $ sudo os-prober
    $ sudo grub2-mkconfig -o /boot/grub2/grub.cfg

In order for Grub2 to detect other operating systems (when it generates the grub.cfg), the os-prober package needs to be installed. This should resolve the issue.

If it does not, it would be interesting to see your grub.cfg:
$ sudo fpaste /boot/grub2/grub.cfg

1 Like

Thanks for the reply Striker. Here is all of the output:

$ sudo dnf install os-prober -y
Last metadata expiration check: 3:34:36 ago on Thu 28 May 2020 11:45:13 AM EEST.
Package os-prober-1.77-4.fc32.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

$ sudo os-prober
/dev/nvme0n1p2@/efi/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi
/dev/nvme1n1p2:Fedora 32 (KDE Plasma):fedora:linux

$ $ sudo grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file …
Found Windows Boot Manager on /dev/nvme0n1p2@/efi/Microsoft/Boot/bootmgfw.efi
Found Fedora 32 (KDE Plasma) on /dev/nvme1n1p2
Adding boot menu entry for EFI firmware configuration
done

$ sudo fpaste /boot/grub2/grub.cfg
Uploading (12.4KiB)…
https://paste.centos.org/view/3928fba8

I just tried to boot into Win 10 from the newly generated Grub file, without any luck. No Win boot and Ubuntu still doesn’t show up.

This looks like a UEFI system, so your grub.cfg should be in /boot/efi/EFI/fedora/, i.e.:
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

If you still can’t boot into any other OS, first check to see if you can select windows or ubuntu with efibootmgr.

1 Like

Thanks for that, alexpl. I can now boot into Win 10, however something else is going on. I have discovered that I have two instances of Fedora 32 KDE - Spin and Jam. I must have installed the one over Ubuntu Studio. Weirdly, the one appears to be always mounted, regardless of which one is running, at least according to KDE Partition Manager.

OK, so I erased the disk with the Fedora 32 KDE spin installed. Now I only have the disk with the Fedora 32 Jam version installed. The problem is that for whatever reason, the boot loader for both versions of Fedora 32 were on the disc that I just erased. How do I install the efi boot loader on the correct disc now? I am currently running the Fedora 32 Jam version which is fortunate, but I don’t know how to sort this out. I know that there is no boot loader for Fedora 32 Jam currently, because I ran $ sudo os-prober and only my Win 10 install showed up.

Interestingly, I get the following when I run ls in /boot:
$ ls
config-5.6.13-300.fc32.x86_64 extlinux initramfs-5.6.6-300.fc32.x86_64.img System.map-5.6.6-300.fc32.x86_64
config-5.6.14-300.fc32.x86_64 grub2 loader vmlinuz-0-rescue-f9aba62ee45b4cea9706ddf420a89374
config-5.6.6-300.fc32.x86_64 initramfs-0-rescue-f9aba62ee45b4cea9706ddf420a89374.img memtest86±5.01 vmlinuz-5.6.13-300.fc32.x86_64
efi initramfs-5.6.13-300.fc32.x86_64.img System.map-5.6.13-300.fc32.x86_64 vmlinuz-5.6.14-300.fc32.x86_64
elf-memtest86±5.01 initramfs-5.6.14-300.fc32.x86_64.img System.map-5.6.14-300.fc32.x86_64 vmlinuz-5.6.6-300.fc32.x86_64

So there is an initramfs and a vmlinuz belonging to Fedora 32 (assuming it is the Jam version).

There is however, nothing in /boot/efi when I run ls.

OK, so I created the necessary directories and tried to run grub2-mkconfig:
$ sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
Generating grub configuration file …
Found Windows Boot Manager on /dev/nvme0n1p2@/efi/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for EFI firmware configuration
done

However, as you can see, I am still not picking up the Fedora 32 Jam install that I am currently running.

I ran $ sudo dnf reinstall grub2-efi shim to be on the safe side.

Not sure what partition the bootloader is on. /boot or root?
An ls in the fedora shows that there is a BOOTX64.CSV, grub.cfg and a grubx64.efi in the folder now:
$ cd /boot/efi/EFI/fedora
$ ls
BOOTX64.CSV fonts grub.cfg grubenv grubia32.efi grubx64.efi mmx64.efi shim.efi shimx64.efi shimx64-fedora.efi

That would make a difference on the efibootmgr command (either 1 or 3?):
efibootmgr -c -d /dev/sda -p 1 -L Fedora -l ‘\EFI\fedora\grubx64.efi’

I tried running the following:
$ efibootmgr -c -d /dev/sda -p 1 -L Fedora -l ‘\EFI\fedora\grubx64.efi’
efibootmgr: ** Warning ** : Boot0004 has same label Fedora
efibootmgr: ** Warning ** : Boot0005 has same label Fedora
efibootmgr: ** Warning ** : Boot0006 has same label Fedora
Could not prepare Boot variable: Permission denied

I’m guessing you’ve been following these instructions, so you should be ok.

Have you tweaked the number of installed kernels?

Actually, you are notified of any other OS the os-prober script found, not Fedora. If a kernel wasn’t found, the grub2-mkconifg would fail earlier.

Always under /boot, where the ESP is mounted. On BIOS systems there’s no partition, the code is usually embedded in the MBR.

You have a bunch of entries with the same label. You can delete them all either through efibootmgr or your computer’s firmware (the “BIOS”) and make a new one. You can name it whatever you want, so that you don’t confuse with something else in the future.

1 Like
  • No, I haven’t tweaked the number of kernels.
  • Ah.
  • OK
  • Yes, -B. Unfortunately, I am unsure which ones I can delete and the syntax. Something like this?
    $ efibootmgr -B 0004 -B 0005 -B 0006 -c -d /dev/sda -p 1 -L Fedora -l ‘\EFI\fedora\grubx64.efi’

Hmm. Weird. I just updated Fedora $ sudo dnf update and now I can’t use Grub to boot into Windows again.

I of course ran:
$ sudo os-prober
$ sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

again and now I can boot into Windows again, but this will quickly become boring having to run those commands all of the time…

The next time you update the Kernel, check the grub.cfg within /boot to see what changes were made. It’s possible that the script to add the new Kernel boot option into Grub is simply being invoked improperly.

1 Like

You don’t need to run os-prober manually, it doesn’t do anything.

Do you still have a /boot/grub2/grub.cfg? If yes, remove it.

What is the output of cat /boot/efi/EFI/fedora/grub.cfg | grep -A 10 Windows?

What about efibootmgr -v?

Also these two:
cat /etc/default/grub
and
ls -l /etc/grub.d/

Please use the “preformatted text” formatting option (icon: </>) for any terminal output you paste here so that it’s easier to read.

Removed.
$ sudo cat /boot/efi/EFI/fedora/grub.cfg | grep -A 10 Windows
menuentry “Windows Boot Manager (on /dev/nvme0n1p2)” --class windows --class os $menuentry_id_option ‘osprober-efi-8A70-33E6’ {
insmod part_gpt
insmod fat
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root 8A70-33E6
else
search --no-floppy --fs-uuid --set=root 8A70-33E6
fi
chainloader /efi/Microsoft/Boot/bootmgfw.efi
}
### END /etc/grub.d/30_os-prober_proxy ###

$ efibootmgr -v
BootCurrent: 0006
Timeout: 1 seconds
BootOrder: 0006,0004,0003,0008,0000,0001,0002,0005,0007
Boot0000* UEFI: PXE IP4 Intel(R) Ethernet Connection (7) I219-V PciRoot(0x0)/Pci(0x1f,0x6)/MAC(a85e45e3d361,0)/IPv4(0.0.0.00.0.0.0,0,0)..BO
Boot0001* UEFI: PXE IP6 Intel(R) Ethernet Connection (7) I219-V PciRoot(0x0)/Pci(0x1f,0x6)/MAC(a85e45e3d361,0)/IPv6([::]:<->[::]:,0,0)..BO
Boot0002* UEFI:CD/DVD Drive     BBS(129,,0x0)
Boot0003* Windows Boot Manager  HD(2,GPT,53f3758e-dfa6-45e1-9b21-ad95ae2a38ea,0x109000,0x32000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}...M................
Boot0004* Fedora        HD(1,GPT,a7910491-ff45-4cb6-8128-29018a1edb5c,0x800,0x200000)/File(\EFI\FEDORA\SHIMX64.EFI)
Boot0005* UEFI:Removable Device BBS(130,,0x0)
Boot0006* Fedora        HD(1,GPT,a7910491-ff45-4cb6-8128-29018a1edb5c,0x800,0x200000)/File(\EFI\FEDORA\SHIM.EFI)..BO
Boot0007* UEFI:Network Device   BBS(131,,0x0)
Boot0008* ubuntu        HD(2,GPT,53f3758e-dfa6-45e1-9b21-ad95ae2a38ea,0x109000,0x32000)/File(\EFI\UBUNTU\SHIMX64.EFI)

$ cat /etc/default/grub
GRUB_TIMEOUT="5"
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT="saved"
GRUB_DISABLE_SUBMENU="true"
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 resume=UUID=6cc96bf2-900f-43b3-b02c-dba29e90b3cf rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG="true"

$ sudo ls -l /etc/grub.d/ 
total 92
-rwxr-xr-x. 1 root root  9346 May 19 21:10 00_header
-rwxr-xr-x. 1 root root   236 May 19 21:10 01_users
-rwxr-xr-x. 1 root root   835 May 19 21:10 08_fallback_counting
-rwxr-xr-x. 1 root root 14962 May 19 21:10 10_linux
-rwxr-xr-x. 1 root root   833 May 19 21:10 10_reset_boot_success
-rwxr-xr-x. 1 root root   892 May 19 21:10 12_menu_auto_hide
-rwxr-xr-x. 1 root root 12285 May 19 21:10 20_linux_xen
-rwxr-xr-x. 1 root root  2562 May 19 21:10 20_ppc_terminfo
-rwxr-xr-x. 1 root root  1019 May 27 16:01 30_os-prober_proxy
-rwxr-xr-x. 1 root root  1415 May 19 21:10 30_uefi-firmware
-rwxr-xr-x. 1 root root   218 May 19 21:10 40_custom
-rwxr-xr-x. 1 root root   220 May 19 21:10 41_custom
drwxr-xr-x. 4 root root  4096 May 27 16:01 backup
drwxr-xr-x. 2 root root  4096 May 27 16:01 bin
drwxr-xr-x. 2 root root  4096 May 27 16:01 proxifiedScripts
-rw-r--r--. 1 root root   483 May 19 21:10 README

It looks like you’ve used grub-customizer and it’s messing with the detection of the other OSs when you install new kernels.

Remove grub-customizer if you’ve installed it in fedora:
dnf remove grub-customizer

Remove the following files from /etc/grub.d/ (if they are still there):

30_os-prober_proxy
backup
bin
proxifiedScripts

Reinstall your grub2 stack:
dnf reinstall grub2*

Your /etc/grub.d/ contents should look like this now:

# ls -l /etc/grub.d/
total 88
-rwxr-xr-x. 1 root root  9346 May 26 18:23 00_header
-rwxr-xr-x. 1 root root   236 May 26 18:23 01_users
-rwxr-xr-x. 1 root root   835 May 26 18:23 08_fallback_counting
-rwxr-xr-x. 1 root root 14962 May 26 18:23 10_linux
-rwxr-xr-x. 1 root root   833 May 26 18:23 10_reset_boot_success
-rwxr-xr-x. 1 root root   892 May 26 18:23 12_menu_auto_hide
-rwxr-xr-x. 1 root root 12285 May 26 18:23 20_linux_xen
-rwxr-xr-x. 1 root root  2562 May 26 18:23 20_ppc_terminfo
-rwxr-xr-x. 1 root root 10673 May 26 18:23 30_os-prober
-rwxr-xr-x. 1 root root  1415 May 26 18:23 30_uefi-firmware
-rwxr-xr-x. 1 root root   218 May 26 18:23 40_custom
-rwxr-xr-x. 1 root root   220 May 26 18:23 41_custom
-rw-r--r--. 1 root root   483 May 26 18:23 README

Reinstall your kernel packages:
dnf reinstall kernel*

Do not run grub2-mkconfig yourself, reboot and try to boot into windows. Does it work now?

On a side note, ubuntu appears to have been installed on a different partition than your fedora system, are you sure you overwrote it with Jam? If that’s the case, you can remove the entry. I would also change the boot order of the entries in BIOS, moving network boot entries below the local files.

OK, everything went fine until this point:
$ sudo dnf reinstall grub2*
Installed package grub2-common-1:2.04-18.fc32.noarch (from updates) not available.
Installed package grub2-efi-ia32-1:2.04-18.fc32.x86_64 (from updates) not available.
Installed package grub2-efi-ia32-cdboot-1:2.04-18.fc32.x86_64 (from updates) not available.
Installed package grub2-efi-x64-1:2.04-18.fc32.x86_64 (from updates) not available.
Installed package grub2-efi-x64-cdboot-1:2.04-18.fc32.x86_64 (from updates) not available.
Installed package grub2-pc-1:2.04-18.fc32.x86_64 (from updates) not available.
Installed package grub2-pc-modules-1:2.04-18.fc32.noarch (from updates) not available.
Installed package grub2-tools-1:2.04-18.fc32.x86_64 (from updates) not available.
Installed package grub2-tools-efi-1:2.04-18.fc32.x86_64 (from updates) not available.
Installed package grub2-tools-extra-1:2.04-18.fc32.x86_64 (from updates) not available.
Installed package grub2-tools-minimal-1:2.04-18.fc32.x86_64 (from updates) not available.
Error: No packages marked for reinstall.

The current version in stable is 2.04-19, so try a
dnf upgrade grub2*

Don’t forget to check if you have the right files in /etc/grub.d/ afterwards.

By the way, you should have led with that bit of information:

Firstly, the correct files are listed in /etc/grub.d/ however, after running:
dnf upgrade grub2*
and
dnf reinstall kernel*
I still can’t boot into Win 10 from Grub2 on reboot.

Regarding grub-customizer, it never occurred to me to mention it as I have never had any problems with it before.

In reference to Ubuntu Studio, I can confirm that it was erased apparently when I installed the Fedora 32 KDE spin. The Fedora 32 KDE spin has now also been erased and at this time, I am only using Fedora 32 Jam (KDE) and Win 10. Unfortunately, I am not sure what I need to do to remove the Ubuntu entry. I first started using UEFI with my new tower computer, as my old home built tower motherboard had a weird UEFI that wasn’t very reliable.

<profanity/>
<sigh/>

If you haven’t recreated the grub.cfg file, can you paste the output of cat /boot/efi/EFI/fedora/grub.cfg | grep -A 10 Windows? If you have recreated it anew, can you do another reinstall of the kernel* packages to see what’s different?

At boot, go into your “BIOS” and change your boot settings from there. While your motherboard has a dedicated keyboard shortcut, in theory you should also be able to use the “System setup” entry in Grub.
From there you can change the boot order of different entries and also remove the non-existent ones.

$ sudo cat /boot/efi/EFI/fedora/grub.cfg | grep -A 10 Windows
menuentry "Windows Boot Manager (on /dev/nvme0n1p2)" --class windows --class os $menuentry_id_option 'osprober-efi-8A70-33E6' {
        insmod part_gpt
        insmod fat
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root  8A70-33E6
        else
          search --no-floppy --fs-uuid --set=root 8A70-33E6
        fi
        chainloader /efi/Microsoft/Boot/bootmgfw.efi
}
### END /etc/grub.d/30_os-prober_proxy ###

I have sorted out the boot order in my BIOS in the meantime.