Grub boot menu not showing after enlarging /boot/efi partition and restoring Windows bootloader through bcdboot

For quite some time I have had the issues dual booting that /boot/efi partition being only 100 MB filled up pretty quickly dual booting between Windows and keeping 2 or 3 kernels, so I decided to face the challenge of enlarging /boot/efi partition, I did it pretty much following this guide: https://superuser.com/questions/1230741/how-to-resize-the-efi-system-partition, which at the beginning I tried to use the gparted method, which failed as it did to most, then I used the space that was already freed and put in the ESP (but not allocated) to format the new partition, after that I changed the uuid and ran grub2-mkconfig with chroot from gparted live USB and upon rebooting everything went well and fedora opened.
The reason I did that is also because one time I accidentally turned off my pc during a windows update thinking stupidly it was over, after that bootmgrw.efi in /boot/efi/EFI/Microsoft disappeared and through a USB with win11 I managed to restore it through bcdboot, it went well and I could get back in windows fully functioning, but when I tried to re do the download something went wrong again and I remembered that prior to that in fedora the /boot/efi partition was full with 0 bytes remaining, so I thought that this probably would be the issue.

I did the bcdboot process again and for some time I went without updating win11, every time I did the bcdboot process after getting back to fedora and generating grub2-mkconfig file it all went smooth and the boot menu appeared after the generation.

This time though after enlarging ESP and restoring bootmgwr.efi and changing the uuid in /etc/fstab, first of all when I first ran the mkconfig it looked like just the Windows entry was generated, not giving any other message about linux kernels even though they were present in /boot/loader/entries directory. After setting:
GRUB_ENABLE_BLSCFG=“false”

the mkconfig successfully sees and generates in theory all of the entries, however the boot menu still doesnt appear during boot, the timeout is already set to 20 as it was already before the issues happened as well as timeout_style=menu, I unset auto_hide_menu env variable from grub2-editenv and upon boot pressing shift key doesnt force the menu to appear, pressing the ESC key makes a bunch of terminal-like lines appear with [ OK ] at the end, I dont know what else to do:
/etc/default/grub

GRUB_TIMEOUT=“20”
GRUB_TIMEOUT_STYLE=“menu”
GRUB_DISTRIBUTOR=“$(sed ‘s, release .*$,g’ /etc/system-release)”
GRUB_DEFAULT=“saved”
GRUB_DISABLE_SUBMENU=“true”
GRUB_TERMINAL_OUTPUT=“console”
GRUB_CMDLINE_LINUX=“rhgb quiet”
GRUB_DISABLE_RECOVERY=“true”
GRUB_ENABLE_BLSCFG=“false”

grub2-editenv list

saved_entry=022440c38d0445ea8da041e033f4949b-6.17.6-100.fc41.x86_64
boot_success=1
boot_indeterminate=0

Has the PARTUUID changed? If so, then you need to update the UEFI boot entries.

just for future reference, I think you are mixing up two things

The ESP (in Fedora mounted to /boot/efi) stores the .efi executables. For example EFI/Microsoft/Boot/bootmgfw.efi and EFI/fedora/shimx64.efi.

Those files are relatively small, and even though 100 MB doesn’t allow for much headroom, it is sufficient for dual booting.

On my F42/W11 dual boot machine I have only 51MB in use: (sudo df -h /boot/efi)

Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p1  524M   51M  474M  10% /boot/efi

/boot on the other hand is where the kernels (and grub stuff) are stored.
You need at least 1 GB here, since F43 2 GB are the new default.

on my system (no nvidia, no rescue kernel, always keeping 4 most recent kernels):

Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme1n1p1  921M  372M  486M  44% /boot

In my case, each kernel is about 100MB, so I can easily increase the number to 5 or higher.

1 Like

yeah you’re right I worded it badly, I didn’t mean that the linux kernels were occupying all the space in /boot/efi, but still the files in it were too big and taking all of the 100 MB, the biggest ones were Microsoft/Boot and /boot/efi/EFI/fedora, but also on /boot/efi/EFI/Linux the .efi files were taking very much space, in fact now that it is enlarged, with 2 kernels Linux folder is weighing a massive 203 MB, that behaviour doesn’t seem normal since you hold 4 kernels + windows easily.

What are the files in that directory?
Something to do with firmware updates maybe?

It doesn’t exist on my machine (Fedora dual-booted with Windows 10 until I get round to wiping Windows).

sudo du -ha /boot/efi/EFI/Linux/

68M /boot/efi/EFI/Linux/{NUM}-6.17.6-100.fc41.x86_64.efi
46M /boot/efi/EFI/Linux/{NUM}-6.17.4-100.fc41.x86_64.efi
4.0K /boot/efi/EFI/Linux/{NUM}-6.17.6-100.fc41.x86_64.efi.hmac
4.0K /boot/efi/EFI/Linux/{NUM}-6.17.6-100.fc41.x86_64.efi.extra.d
90M /boot/efi/EFI/Linux/{NUM}-6.17.6-100.fc41.x86_64+debug.efi
4.0K /boot/efi/EFI/Linux/.{NUM}-6.17.6-100.fc41.x86_64+debug.efi.hmac
4.0K /boot/efi/EFI/Linux/{NUM}-6.17.6-100.fc41.x86_64+debug.efi.extra.d

These are the files that I have in there, prior to the enlarging I arrived to keeping only 1 kernel, which was weighing around 50 MB if I remembered correctly

If you mean updating the UUID of /boot/efi in fstab yes I already did that

Very interesting. These look like UKIs (Unified Kernel Images), though I’m not sure what would make those appear on a normal Fedora desktop edition. (I believe the Fedora Cloud server editions use them to some extent.)

1 Like

Could you show the output of these:

lsblk -f

sudo cat /boot/efi/EFI/Fedora/grub.cfg

efibootmgr

That looks like you installed some kernel packages you don’t need. For example kernel-uki-virt.x86_64 and kernel-debug-uki-virt.x86_64 is some test packages for testing uki kernels on virtual machines.

2 Likes

$ lsblk -f

NAME        FSTYPE FSVER LABEL  UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
zram0                                                                               [SWAP]
nvme0n1                                                                             
├─nvme0n1p1 vfat   FAT32        2DE7-3B65                             545.9M    32% /boot/efi
├─nvme0n1p2                                                                         
├─nvme0n1p3 ntfs                1E10BB8A10BB6803                                    
├─nvme0n1p4 ntfs                16DCFDDDDCFDB6D9                                    
├─nvme0n1p5 ext4   1.0          92cbe6bf-96cc-458c-b205-8ee8c5b53847  370.8M    55% /boot
└─nvme0n1p6 btrfs        fedora 22db4ddc-7145-4ae3-8422-2709347c9f81  471.6G     7% /home
                                                                                    /

sudo cat /boot/efi/EFI/Fedora/grub.cfg

search --no-floppy --root-dev-only --fs-uuid --set=dev 92cbe6bf-96cc-458c-b205-8ee8c5b53847
set prefix=($dev)/grub2
export $prefix
configfile $prefix/grub.cfg

efibootmgr

BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0001,0000,0003
Boot0000* Fedora Linux 41 (Workstation Edition) 6.17.6-100.fc41.x86_64 (UKI) on EFI system partition	HD(1,GPT,50167b90-e0e8-41dc-a91a-6749808556ab,0x800,0x190000)/\EFI\fedora\shimx64.efi5c004500460049005c004c0069006e00750078005c00300032003200340034003000630033003800640030003400340035006500610038006400610030003400310065003000330033006600340039003400390062002d0036002e00310037002e0036002d003100300030002e0066006300340031002e007800380036005f00360034002e00650066006900200072006f006f0074003d0055005500490044003d00320032006400620034006400640063002d0037003100340035002d0034006100650033002d0038003400320032002d00320037003000390033003400370063003900660038003100200072006f00200072006f006f00740066006c006100670073003d0073007500620076006f006c003d0072006f006f0074002000720068006700620020007100750069006500740020000000
Boot0001* Fedora	HD(1,GPT,50167b90-e0e8-41dc-a91a-6749808556ab,0x800,0x190000)/\EFI\fedora\shimx64.efi
Boot0003* Windows Boot Manager	HD(1,GPT,50167b90-e0e8-41dc-a91a-6749808556ab,0x800,0x190000)/\EFI\Microsoft\Boot\bootmgfw.efi0000424f
Boot0004* Windows Boot Manager	HD(1,GPT,50167b90-e0e8-41dc-a91a-6749808556ab,0x800,0x190000)/\EFI\Microsoft\Boot\bootmgfw.efi57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d0000006f000100000010000000040000007fff0400

if that is the case that’s crazy, you mean I can just delete the Linux folder in /boot/efi and uninstall those packages?

No, but remove the packages that installed them.

I actually have those packages installed, I have no idea how they finished there, are they included in some general purpose kernel package? So I am just safe to sudo dnf removing them right?

Interesting, your first-choice default boot is supposed to be into Fedora GRUB (0001) but in your current session you booted into the UKI image (BootCurrent is 0000), bypassing GRUB.

I would be inclined to try efibootmgr --delete-bootnum 0000 so that the only Fedora item there is the EFI that loads GRUB.

Mh, that is interesting, the boot 0 has been the default option since know, when I pasted @anotheruser answer to claude to check which partuuid he was talking about (because I already updated the one in /etc/fstab before this thread, so I wanted to double check if I missed one) Claude gave me this command:
sudo efibootmgr -c -d /dev/nvme0n1 -p 1 -L "Fedora" -l '\EFI\fedora\shimx64.efi
Which when I executed it created this entry, so I’m gonna try to do that, should I also run grub2-mkconfig -o /boot/grub2/grub.cfg?

Shouldn’t do any harm, but probably won’t change anything, since from your OP it sounds like you updated it recently.

Alright I deleted the entry, I’ll try rebooting now

There’s a suggestion here that they were pulled in for VirtualBox users when upgrading to Fedora 38:

Upon rebooting, it jumps me directly to windows Lol, so that boot entry is not working properly, I guess now I have to write a live USB to boot back in fedora right?