Grub2-mkconfig identifies my fedora 35 installation but does not create a grub entry

Hi had a dual boot system with fedora 35 and ubuntu with some empty space between the two partitions which originally was left to accommodate solus. Yesterday I installed fedora 34 in that partition, now the problem is grub of fedora 34 does not show an entry for fedora 35,(though there is an entry for Ubuntu). Fedora 35 is my main OS so I need it back soon. I tried running grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg which returned this

Generating grub configuration file …
Found linux image: /boot/vmlinuz-5.11.12-300.fc34.x86_64
Found initrd image: /boot/initramfs-5.11.12-300.fc34.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-7e57a60fb75a4266b34f2c022a99e75d
Found initrd image: /boot/initramfs-0-rescue-7e57a60fb75a4266b34f2c022a99e75d.img
Found Ubuntu 21.10 (21.10) on /dev/sda5
Found Fedora Linux 35 (Workstation Edition) on /dev/mapper/luks-a37a5eed-f004-43c1-9fa7-223892c8126f
Found Ubuntu 21.10 (21.10) on /dev/sda5
Found Fedora Linux 35 (Workstation Edition) on /dev/mapper/luks-a37a5eed-f004-43c1-9fa7-223892c8126f
Found linux image: /boot/vmlinuz-5.11.12-300.fc34.x86_64
Found initrd image: /boot/initramfs-5.11.12-300.fc34.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-7e57a60fb75a4266b34f2c022a99e75d
Found initrd image: /boot/initramfs-0-rescue-7e57a60fb75a4266b34f2c022a99e75d.img
Found Ubuntu 21.10 (21.10) on /dev/sda5
Found Fedora Linux 35 (Workstation Edition) on /dev/mapper/luks-a37a5eed-f004-43c1-9fa7-223892c8126f
Adding boot menu entry for UEFI Firmware Settings …
done

So obviously the system detects the Fedora 35 installation but when I reboot I still can’t see the Fedora 35 entry. So that probably means grub was not updated. So how can I update grub to reflect the change.
Thank you.
`

You managed to mess up both fedora 34 & 35 with this command.
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
The change from fedora 33 to 34 converted the main fedora grub.cfg file from that location to /boot/grub2/grub.cfg.

That means the file in /boot/grub2/grub.cfg will be the correct one and should be able to be used, but there are a couple of assumptions I make here.

  1. I assume that you have only one efi/esp partition? and that it is mounted at /boot/efi for both fedora installs?
  2. I also assume that Ubuntu uses the same efi/esp partition.
  3. I have to assume that both fedora installs have unique /boot partitions as well as unique / partitions.

If this is correct then you simply need to boot to one of the fedora installs then do.

sudo rm /boot/efi/EFI/fedora/grub.cfg
sudo dnf reinstall grub2-efi

Reinstalling grub-efi will restore the proper /boot/efi/EFI/fedora/grub.cfg file.
Follow that with

sudo grub2-mkconfig -o /boot/grub2/grub.cfg

The above steps should work. If, however, you did not make discrete /boot partitions then the fedora 34 install may have wiped out the kernel initrd & vmlinuz images for fedora 35.

You may have to do some investigation to see exactly what is where on each partition you have. The commands lsblk and sudo parted -l would be the place to start to see if the partitions are as you expect.

In general, when using multiple boot linux OSes it is important that you always keep the grub boot config managed by a single one of those to avoid unexpected interactions.
Also be aware that since there are differences in fedora 34 and 35 grub configs, the content of /boot/efi/EFI/fedora may be different so that - by itself - can cause a conflict between the versions. The conflict can be minimized by having a separate efi partition for each, but only one can be used as the esp (efi system partition) used for booting. Using extra efi partitions also adds additional management issues.

3 Likes