Fedora entries do not show in grub menu after fresh install - ISSUE SOLVED

TL;DR:

  • Issue: After a fresh install of Fedora 44 I could not see a listing for it in the Fedora grub2 menu.
  • Root cause: The “loader” directory and kernel were in my efi system partition, i.e. /boot/efi/loader, and not in the /boot/loader directory
  • Solution: I removed the (unneeded) loader directory and kernels from my efi partition and reinstalled grub and the core kernel files from the live USB.

I thought I’d share my experience here since this was a fixable issue, but it took me some digging to figure out. Maybe this is common knowledge to those more experienced, but it became my primer into bootloaders.

I’ve switched to Linux at home for about six month now using Debian as a home base as I multi-booted other distros to try them out. I was running Fedora 43 on a small ext4 partition and decided to move to Fedora 44 as my new home base. I repartitioned my drive with btrfs/snapshots in mind. I wanted to keep the Debian installation for now, so I tried my best to clean up the mess left over on my efi partition by the other distros - it’s much easier to install Linux than uninstall, I’ve found!

I had also tested Linux Mint, Pop_OS, KDE Neon, and Debian with GNOME.
Linux installs had been on a SSD, and I have Win10 on an nvme with its own efi partition.

  • sda1 = efi
  • sda2 = Debian ext4
  • sda3 = Fedora /boot ext4
  • sda4 = Fedora btrfs volume containing / and all other Fedora subvolumes

After a fresh install of Fedora 44 I booted into a grub menu that showed Debian and Windows, but no Fedora. I had installed from the Fedora 44 Everything iso, and tried reinstalling with the Fedora 44 KDE iso, but had the same results. So I mounted up from Debian or the live USB, and here’s all the items I checked:

  • It looked like the installation to the btrfs root (sda4) volume was fine
  • It APPEARED like the installation to the /boot (sda3) partition was fine (it was not)
  • I checked the files in the efi (sda1) partition: I could see EFI/fedora directory with the shim and grubx64.efi files. Also, the efibootmgr entries were properly pointing to them.
  • From the live USB, I tried grub2-mkconfig after mounting all the partitions, binding system directories, and chroot - still no Fedora option in grub2 menu.
  • I tried to update Debian’s grub config to boot Fedora, but that didn’t work (it had been able to boot Fedora 43, so I was hoping…)
  • I noticed remnants of the other OS installations on my efi partition and didn’t know if any of that was causing an issue. I set about try to understand what it all was and clean it up. I deleted the leftover /EFI/neon, /EFI/ubuntu (Mint), and EFI/systemd (Pop_OS) directories.

I was a bit discouraged after the grub2-mkconfig didn’t work, but finally found a post referencing the .conf files grub2 uses from the /boot/loader/entries directory. My /boot/loader/entries directory was not where it was supposed to be, however, and I found it on my EFI partition at /boot/efi/loader/entries. Inside I found the .conf files for Fedora 43, Fedora 44, and Pop_OS. Also on my efi partition were 4 directories with long names that looked like UUIDs to me, and they contained the kernels for F43, F44, and Pop. These long UUID? names matched the .conf files, so I knew the kernels corresponded to those OS installs. Now that I was on the right path, a few more searches helped me piece together what happened. Those of you who know this stuff well, please correct anything I get wrong here:

  • I had installed Pop_OS which uses systemd to boot instead of grub. Pop_OS puts the loader and kernel files on the efi partition, which is where systemd expects them.
  • Fedora’s default installation has a separate partition for /boot, and it’s grub2 bootloader expects the loader directory and kernel files to be there.
  • I believe when I installed Fedora, it saw the existing loader directory on the efi partition, and installed there since it already existed.
  • I recall briefly reading that if Fedora’s /boot folder is in a btrfs subvolume, it will install the grub and kernel files to the efi partition. My guess is the install script gets confused by the existing directories on the ESP, installs the bootloader and kernel there, but is still trying to boot from /boot.

Here’s what I did to fix the problem:

  • I deleted the directories with the kernel files on the efi partition that had the long UUID? names.
  • I deleted the loader directory on the efi partition.
  • I reinstalled grub2 and the kernel core from the Fedora 44 live USB. This involves mounting all the proper partitions and binding necessary system directories, doing a chroot to the mounted system, and reinstalling grub2 and kernel-core. If you don’t know how to do this, search for “process to reinstall the grub and kernel files to the /boot directory in fedora 44” and any chatbot should give you the steps. The key will be to sudo dnf reinstall shim-* grub2-* kernel-core.
  • Finally, I regenerated the grub2 configuration with grub2-mkconfig -o /boot/grub2/grub.cfg.

After unmounting everything and rebooting, I could see Fedora in grub, alongside my Debian and Windows installations. It also dawned on me that Fedora 43 had not installed properly either, and I understood why I could never boot from its own grub. I had been using Debian’s grub, which was able to boot F43 without issue.

Sorry for the long post, but I hope this can help someone in a similar situation. Looking at the contents of your efi partition, specifically for a loader directory, before installing Fedora is a good idea, especially if you have a multi-boot situation or aren’t setting up a new efi partition.

I think I’ll post this to the reddit Fedora board as well. I hope that’s not considered cross-posting for this community, lol.