Fedora boot entry not present in its own grub bootloader

Hello there,

I had dual booted fedora 40 along with windows. I wanted to have a fresh start so deleted the current fedora partition. I restarted with the fedora in my pen-drive only to see the old grub with fedora 40 entries. Assuming that the new installation will handle it and refresh the entries, I went ahead only to get an error popup with this message:

The following error occurred while installing the boot loader. The system will not be bootable. Would you like to ignore this and continue with installation? 

Failed to set new efi boot target. This is most likely a kernel or firmware bug.

Now when I restart, I see that the grub boot loader has Windows option but not the Fedora 41.

Since last night I saw various posts and tried various things.

  1. Sorry can’t link the post, can’t find it. The post mentioned using bcdedit on windows to delete fedora entries and then going into system>EFI and removing the fedora folder.

I noticed that the grub.cfg was not present in either /boot/grub2/ or /boot/efi/EFI/fedora/

  1. From this post, I tried reinstalling grub as grub2-common would re-create it but did not.

  2. Tried updating grub using sudo grub2-mkconfig -o /etc/grub2.cfg but this error was shown:

/usr/sbin/grub2-probe: error: failed to get canonical path of `LiveOS_rootfs'.

Most probably because I am using the fedora through the live usb. Everything would be settled once I restart (right?) but I can’t boot into fedora upon restarting.

There were other things although minor. One similar post mentioned that they erased everything and installed fedora and then windows. I am happy with this too. But since the first error mentions this being a firmware error so I am not sure if this won’t be back to haunt me after erasing everything.

I have even tried a different distro although I don’t want to. I tried mint but worse things happen as I get stuck in grub terminal upon restart.

How can I fix this? Help in erasing everything would also be nice. I just want to be back to work. My poor laptop can’t handle app dev from windows. I need the linux.

Thanks!

First, the suggestion to

seems appropriate. That would have been the f40 efi data.

Next, did you also delete the ext4 partition where /boot resides? If not that also could interfere.

My suggestion.
While booted into the live media install gparted (from a terminal) sudo dnf install gparted
Then use gparted to remove the ext4 /boot partition and the btrfs fedora partition.

exit gparted then identify the efi partition lsblk -f (to see the partition id) then mount it with sudo mount <efi partition> /mnt
Remove the folder /mnt/EFI/fedora sudo rm -r /mnt/EFI/fedora
dismount the efi partition sudo umount /mnt
finally do a new clean installation.

Yes, deleted all I could. Leaving only the Windows partitions.

Now, I installed gparted and tried doing what you mentioned. But the two ext4 and btrfs partitions were shown as locked and I could not* remove them. Maybe because I had already gone through the installation process.

So I did it all again. Back from windows again and now the partitions are not here. Here is what the gparted looks like:

As you can see, all partitions are windows related, there is one unallocation 187 GB which will be used for fedora.

And now, I have tried the lsblk -f command.

Here is the output:

liveuser@localhost-live:/etc/yum.repos.d$ lsblk -f
NAME FSTYPE FSVER LABEL       UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0
     squash 4.0                                                          0   100% /run/rootfsbase
sda                                                                               
└─sda1
     vfat   FAT32 FEDORA-KDE- 2643-31BF                                26G     9% /run/initramfs/live
zram0
                                                                                  [SWAP]
nvme0n1
│                                                                                 
├─nvme0n1p1
│    vfat   FAT32 SYSTEM      9A80-A5E0                                           
├─nvme0n1p2
│                                                                                 
├─nvme0n1p3
│    ntfs         OS          AAC28276C2824713                                    
├─nvme0n1p4
│    ntfs         RECOVERY    7ED2FF10D2FECB81                                    
└─nvme0n1p5
     vfat   FAT32 MYASUS      E27C-D048     

You mentioned identifying the efi partition, but since the fedora part is un-allocated at the moment, it is not showing. Or am I misunderstanding?

The efi partition appears to be nvme0n1p1 on the SSD.
Mounting it would be sudo mount /dev/nvme0n1p1 /mnt and that then would be where you need to remove the /mnt/EFI/fedora directory and content before doing the reinstall

While booted to the live media and before redoing the install you might use the efibootmgr to remove any existing fedora boot entries in bios.
efibootmgr should return a list such as

# efibootmgr
BootCurrent: 0000
Timeout: 1 seconds
BootOrder: 0000,0009,000A,000B
Boot0000* Fedora	HD(1,GPT,3e9fc420-a651-4d1e-b8e7-f1fac4970613,0x800,0xa7800)/\EFI\FEDORA\SHIMX64.EFI
Boot0009* Fedora	HD(1,GPT,3e9fc420-a651-4d1e-b8e7-f1fac4970613,0x800,0xa7800)/\EFI\FEDORA\SHIM.EFI0000424f
Boot000A* Hard Drive	BBS(HD,,0x0)0000474f00004e4fad00000001000000750053005400340030003000300056004e003000300038002d0032004400520031003600360000000501090002000000007fff040002010c00d041030a0000000001010600020101010600010003120a000200ffff00007fff040001043e00ef47642dc93ba041ac194d51d01b4ce620002000200020002000200020002000200020002000200044005a0042004800460031004600370000007fff04000000424f00004e4fad00000001000000750053005400380030003000300056004e003000300034002d0032004d00320031003000310000000501090002000000007fff040002010c00d041030a0000000001010600020101010600010003120a000300ffff00007fff040001043e00ef47642dc93ba041ac194d51d01b4ce620002000200020002000200020002000200020002000200053005700360044005a004c004a004e0000007fff04000000424f00004e4fad00000001000000750053005400340030003000300056004e003000300038002d0032004400520031003600360000000501090002000000007fff040002010c00d041030a0000000001010600020101010600010003120a000400ffff00007fff040001043e00ef47642dc93ba041ac194d51d01b4ce620002000200020002000200020002000200020002000200044005a0042004800350031004400520000007fff04000000424f00004e4fad00000001000000750053005400340030003000300056004e003000300038002d0032004400520031003600360000000501090002000000007fff040002010c00d041030a0000000001010600020101010600010003120a000500ffff00007fff040001043e00ef47642dc93ba041ac194d51d01b4ce620002000200020002000200020002000200020002000200044005a00410048003800580058004b0000007fff04000000424f00004e4f99000000010000006b00430054003200300030003000500035005000530053004400380000000501090002000000007fff040002010c00d041030a00000000010106000101010106000000031710000100000000a075013d64dd837fff040001042e00ef47642dc93ba041ac194d51d01b4ce632003200350031003300440036003400440044003800330000007fff04000000424f
Boot000B* CD/DVD Drive	BBS(CDROM,,0x0)0000474f00004e4fb900000001000000750048004c002d00440054002d00530054002000420044002d00520045002000200057004800310034004e0053003400300000000501090003000000007fff040002010c00d041030a0000000001010600020101010600010003120a000100ffff00007fff040001043e00ef47642dc93ba041ac194d51d01b4ce639004b0046004700350032003200390030003100200037002000200020002000200020002000200000007fff04000000424f
Boot000E* USB	BBS(USB,,0x0)0000474f00004e4fb90000000100000071004c0065007800610072002000550053004200200046006c00610073006800200044007200690076006500200038002e003000370000000501090005000000007fff040002010c00d041030a000000000101060001080101060003000305060003007fff040001043e00ef47642dc93ba041ac194d51d01b4ce64400300035004500420041003900440041003200460046003800460034004400350030003800360000007fff04000000424f

(and probably more including the windows entry)
You can remove an individual entry there (for example Boot0009) with something like sudo efibootmgr -b 0009 -B which would remove that entry from the bios.

Once the bios entries no longer contain the fedora entries then perform the installation and it should work this time.

Still get the error.

I deleted the /mnt/EFI/fedora directory. I assume that is what I was doing with diskpart>select vol 1>assign letter=z>exit>z:>cd EFI>rmdir /s fedora in Windows.

Although even after removing from this side, I went on windows and followed the above mentioned steps and still had to delete it (weird?).

Well, trying efibootmgr gave this response:

root@localhost-live:/# efibootmgr
BootCurrent: 0004
Timeout: 2 seconds
BootOrder: 0003,0004
Boot0003* Windows Boot Manager  HD(1,GPT,ac621092-0eb5-4bac-9980-ba26a8298174,0x800,0x82000)/\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d00000000000100000010000000040000007fff0400
Boot0004* UEFI: SanDisk, Partition 1    PciRoot(0x0)/Pci(0x14,0x0)/USB(15,0)/HD(1,MBR,0x4f9ae,0x800,0x39477e0)0000424f

There are only two entries, 0003 being windows and 0004 being the pendrive. Hence I don’t think deletion was necessary.

I then installed again to see the same error.

I have no idea if this is the same. It has been years since I used windows with any sort of admin tasks. I use fedora 99.99% of the time.

The steps I provided would have done that from within fedora which is what I am familiar with.
Your steps do not even show if you were in the proper directory nor if the fedora directory was there.

The efibootmgr response shows that it did not find any fedora entries to boot so that is a good thing.

We cannot tell what actually happened without more detail than I then installed again to see the same error.

How did you do the install?
Were there any errors during the install?
Did you wait until the install screen showed the button “finish” in the lower right corner before rebooting?
If you waited then fedora should have rebooted properly and if it did not then exactly what was seen after waiting some time for the boot to complete?
Does your system have an nvidia GPU?
Did you hold down shift after the bios screen while booting so the grub menu was displayed? or was it displayed automatically?

Once we have details, and if suggested steps are followed exactly then fixes may be possible. If you do not follow suggestions then the results may not be what is expected.

What did you see when trying to perform the removal? Without details we cannot tell what may or may not have occurred. If there was an error when attempting to remove that from within fedora then it is not surprising to see the need to remove it from within windows but we cannot tell without 2 way communications and leaping off on your own.

Well, apologies for not sharing details properly.

I tried again. So, first I deleted the partition because it was filled in the last try.

I did two things on Windows side:

  1. Deleted firmware application added upon the install. I did that by running bcdedit /enum firmware which listed out the firmware applications some of which are the Windows boot manager, Firmware boot manager, and so on.
Firmware Application (101fffff)
-------------------------------
identifier              {30a24319-cc78-11ef-b8cd-806e6f6e6963}
device                  partition=\Device\HarddiskVolume1
path                    \EFI\FEDORA\SHIMX64.EFI
description             Fedora

This was the entry for Fedora in it, I copied the identifier and used bcdedit /delete {identifier} /f to remove it.

  1. Next, I used command diskpart which opened a different terminal. I used list vol which lists all volumes present. Output is like this:
DISKPART> list vol

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
  Volume 0     C   OS           NTFS   Partition    287 GB  Healthy    Boot
  Volume 1         SYSTEM       FAT32  Partition    260 MB  Healthy    System
  Volume 2         RECOVERY     NTFS   Partition   1000 MB  Healthy    Hidden
  Volume 3         MYASUS       FAT32  Partition    200 MB  Healthy    Hidden
  Volume 4     D   FEDORA-KDE-  FAT32  Removable     28 GB  Healthy

Here the System labelled entry Volume 1. I select it using select vol 1 and give it a letter name using assign letter=z for ease of use outside diskpart. I exit diskpart using exit. Back to normal terminal.

I use z: to shift to this partition storage. dir here results this:

Z:\>dir
 Volume in drive Z is SYSTEM
 Volume Serial Number is 9A80-A5E0

 Directory of Z:\

24-10-2024  09:55    <DIR>          System
24-10-2024  09:50    <DIR>          EFI
17-07-2024  19:00                34 mach_kernel
14-06-2022  04:33        20,054,016 X1502ZAAS.302
06-01-2025  01:43    <DIR>          boot
06-01-2025  01:43    <DIR>          dev
06-01-2025  01:43    <DIR>          proc
06-01-2025  01:43    <DIR>          sys
06-01-2025  01:43    <DIR>          run
06-01-2025  01:43    <DIR>          bin
06-01-2025  01:51    <DIR>          lib
06-01-2025  01:52    <DIR>          usr
06-01-2025  01:58    <DIR>          lib64
06-01-2025  02:12    <DIR>          var
               2 File(s)     20,054,050 bytes
              12 Dir(s)     198,631,424 bytes free

I then use cd EFI and then again dir looks like this:

Z:\EFI>dir
 Volume in drive Z is SYSTEM
 Volume Serial Number is 9A80-A5E0

 Directory of Z:\EFI

14-10-2022  20:15    <DIR>          .
14-10-2022  20:15    <DIR>          ..
14-10-2022  20:15    <DIR>          Microsoft
24-10-2024  09:55    <DIR>          Boot
07-01-2025  03:16    <DIR>          fedora
               0 File(s)              0 bytes
               5 Dir(s)     198,631,424 bytes free

Next I deleted the fedora directory using rmdir /s fedora which successfully deletes it.

Now I restart my laptop and use to boot using the pendrive. Fedora KDE opens up.

Here ext4 /boot partition and the brtfs partitions do not exist. I then mount the EFI partition and see that fedora folder is not present inside /mnt/EFI/.

Then I check efibootmgr to see only the two entries. So feeling okay to install I click on the installation icon present on the top left. Go through the options. Automatic partition management. Add root password. And then being the installation. After the system installation completes and bootloader installation starts I get the error message I mentioned at the very start. Then again after a while in the middle of a different process I again get the error message. Moving on clicking on ‘Yes’ to the error messages, the installation completes.

Then I restart, go into bios/firmware settings, switch priority to fedora and save. It restarts and the bootloader appears with only the Windows option.

Yes, twice, at the same time as usual as mentioned above.

Yes

After the second error is shown, just a min and then the installation ends. I click the finish button and the application window closes. I then restart, open bios, change boot order, move fedora forward and see that the Fedora option is not present in bootloader.

No, it is simple one called ‘Intel UHD Graphics’.

It opened automatically. Now that I notice, I read it that if only one system is detected it skips the menu and pressing on shift shows it. So it does find multiple systems, just not show the option.

This looks odd to me:

Z:\>dir
 Volume in drive Z is SYSTEM
 Volume Serial Number is 9A80-A5E0

 Directory of Z:\

24-10-2024  09:55    <DIR>          System
24-10-2024  09:50    <DIR>          EFI
17-07-2024  19:00                34 mach_kernel
14-06-2022  04:33        20,054,016 X1502ZAAS.302
06-01-2025  01:43    <DIR>          boot
06-01-2025  01:43    <DIR>          dev
06-01-2025  01:43    <DIR>          proc
06-01-2025  01:43    <DIR>          sys
06-01-2025  01:43    <DIR>          run
06-01-2025  01:43    <DIR>          bin
06-01-2025  01:51    <DIR>          lib
06-01-2025  01:52    <DIR>          usr
06-01-2025  01:58    <DIR>          lib64
06-01-2025  02:12    <DIR>          var
               2 File(s)     20,054,050 bytes
              12 Dir(s)     198,631,424 bytes free

A normal ESP would not have any of the directories starting with boot at its root level. Also is it normal for mach_kernel to be there? Isn’t that for Machintosh installs?

About the boot directory, that would be my doing. When I was doing here and there to fix this, I was trying to manually add a boot entry and following a post that suggested mounting the System partition and then mounting some folders to it which included the dev, proc, sys, etc. Although it didn’t include boot, I had done that.

About the mach_kernel, I do not know. I have never liked to or tried to install machintosh.

You must umount that partition before beginning the installation so it is unused.

This looks OK
After removing the fedora directory you should do nothing else but start the installation.

Adding extra stuff following that anonymous post is merely adding extra garbage that results in GIGO for following steps.

I would do that in this order.

  1. remove the fedora folder on the efi partition.
  2. boot the live media and perform the installation.

Any additional steps merely muddies the results so we cannot tell what is happening.
The installer handles everything without user input by design.

This time, I only did these things.

  1. Delete the partition using the windows disk management.
  2. Use the live usb to boot into Fedora.
  3. Mount to the EFI partition using sudo mount /dev/nvme0n1p1 /mnt.
  4. Delete the fedora directory. I checked, it was deleted successfully.
  5. Unmount the EFI partition using sudo umount /dev/nvme0n1p1.
  6. Start the installation.

But I still faced the error. Nothing new.

I thought the problem could be because of different reasons, so used a different usb drive with fedora workstation. But still the same thing. I think I would just wipe everything out now. But don’t know if the same won’t happen after that or not.

Are you booting in UEFI mode? Some systems will show two device lists when you press F12 to bring up the BIOS boot menu – items under one list will be labeled “legacy” boot and items under the other list will be “EFI” or “UEFI” boot. You need to select the EFI/UEFI option when booting the Fedora Live image.

In my bios, I see only one boot menu with only the Fedora and Windows options present.

I’d give up on Grub and use systemd-boot instead. Unfortunately, switching out the boot loader is a non-trivial task.

Actually it is quite trivial. Step one: Disable secure boot. The rest is easy.

Aren’t there also partitioning difficulties? Grub uses separate /boot and /boot/efi mount points, but systemd-boot just uses one (it puts it all on the ESP). You’d need to do a little re-partitioning to ensure that your ESP is large enough for the combined content. Doing that and ensuring that you don’t lose your Windows boot loader is even more difficult. (It’s doable, but you have to make sure you don’t change the partition UUID. Or you could probably re-add the Windows boot loader via the BIOS menus or using efibootmgr.)

Changing the ESP partition size could easily be mandatory. IME I have seen an ESP created by windows that range from ~100MB to ~250MB but have never seen one of those that came near to the currently standard fedora size of ~600MB.

Regardless, it seems a systemd boot ESP needs to be a minimum of 600MB and enlarging it takes a bit of finegalling to obtain enough space to do so. As already noted, unless the UUID remains it would break windows booting.

These changes would also affect the other windows partitions that are packed into the beginning of the drive.

One possibility that would simplify the switch would be to create an entirely new fedora ESP (easiest with a new custom installation) so modifications would not be needed on the windows ESP.

That might work (it probably would). But it goes against the UEFI spec. There is only supposed to be one ESP per drive. It should also be the first partition.

It’s too bad grub-probe isn’t working on this machine, but I think the user is really left up a creek without a paddle when the software relies on that sort of automation. Systemd-boot is a little better in that respect. Manual installation is possible by simply copying a couple files into place.

It’s also unfortunate that MS won’t sign the systemd-boot boot loader. But IMHO secure boot is a bit of a joke anyway. If someone really wants security at that level, they’d need to start by swapping out the entire firmware with something like libreboot.

@computersavvy and @glb

What if we put Windows out of the discussion? I am willing to remove windows, entirely. Then what can be the best solution.

About removing grub. I am not hardcode linux user. I just use linux 99% of the time for daily uses. So removing it would mean going out of normal hence less support posts for future problems. So would not prefer it, plus it sounds like I may mess it up. But if its the best solution then sure, will think about the future in the future.

What if we just create a new ESP focused on fedora and forget about the Windows ESP. LIke, delete it along with windows. And then if I need windows, I would reinstall with the newer fedora based ESP.

Yes, that is the best option.

If you want to hold off on deleting Windows until you are sure Fedora Linux will work on your machine. Another option might be to temporarily disable or swap out the current internal drive and install Fedora on a different disk.

Another option you might want to consider is making a backup of your Windows installation. Windows has a built-in backup utility that should work to create a bootable backup of your entire Windows installation. Then you can delete everything from your internal drive and if you really need to go back to Windows, you should be able to boot from your recovery drive and re-install Windows.

1 Like