Bootloader installation has failed: Failed to set new efi boot target. This is most likely a kernel or firmware bug

Trying to install Fedora 36 but the installer keeps hanging up on the bootloader. From the log:

INFO:program:Running in chroot '/mnt/sysroot'... grub2-mkconfig -o /boot/grub2/grub.cfg
INFO:program:Generating grub configuration file ...
INFO:program:grub2-probe: error: cannot find a GRUB drive for /dev/sda1.  Check your device.map.
INFO:program:grub2-probe: error: cannot find a GRUB drive for /dev/sda3.  Check your device.map.
INFO:program:Adding boot menu entry for UEFI Firmware Settings ...
INFO:program:done
DEBUG:program:Return code: 0
ERROR:anaconda.modules.storage.bootloader.installation:Bootloader installation has failed: Failed to set new efi boot target. This is most likely a kernel or firmware

Edit: I am installing this on an SSD, that it’ s talking about /dev/sda* might be part of what’ s going wrong. This is a Lenovo Ideapad S145, UEFI is enabled rather than Legacy BIOS.

Here is the full log.

Welcome @aswyg to ask :fedora:

The error is inconclusive to me since you did not tell us anything about how you were performing the install.

The log on pastebin appears to show you were installing to the internal drive (nvme0n1) and that partitions were created for /boot (nvme0n1p2) /boot/efi (nvme0n1p1) and / and /home (nvme0n1p3) with btrfs & luks encryption.

The specific log entry you posted shows sda1 & sda3; which I would assume is the USB device used for the install.

Please provide us more detail on how you are doing the install, including the device(s) selected for the install, are you doing an install to the full drive and no dual boot or using dual boot, automatic partitioning?, and any other details pertinent to the config.

1 Like

Hi,

  • I was using the automatic partitioning.
  • No dual boot.
  • I have tried with the encryption flag on and off,
  • and I have tried to format the SSD before beginning an installation.
  • I’ve tried to use the custom partitioner and let it select the mountpoints itself,
    … but the installation always fails when it’s installing the bootloader. I have even tried disconnecting the (by design) untouched hard drive (not the main nvme). I am indeed using a liveusb flash drive to install the OS.
1 Like

Just for verification.
Have you gone into the BIOS and checked the settings for boot mode. Since you have an nvme drive and are installing it as the only OS I would suggest that you set the boot mode to uefi only. It may have been set as CSM or similar and that could be confusing the boot loader.

You also, since you do not want to load to the second drive, should make certain that you select only the nvme drive for the install and tell it to use the entire drive and wipe out all existing partition data during the setup.

It actually sounds to me like it may have some remaining part of a prior install in the partition table that is confusing the boot loader during the install. If that is the case then making certain that it wipes out all existing partition data and completely rebuilds it should help.

Another thing you can try is to manually wipe out the existing partition table before you start. To do that, while in the live USB screen before starting the install, open a terminal window and then

  1. su to get root access
  2. fdisk /dev/nvme0n1 to open fdisk for the nvme drive
  3. g to tell fdisk to create a new gpt empty partition table
  4. w to write the new partition data to the device

These steps will first switch you to root, open fdisk to edit the partition table for nvme0n1, create a new empty GPT partition table, and write the data to the device.

After you have done that then open the installer and select only the nvme drive for the install and the auto install should work properly.

Have you gone into the BIOS and checked the settings for boot mode

It’s set in UEFI mode, aside from this I can also select Legacy mode. But it is set in UEFI mode.

You also, since you do not want to load to the second drive, should make certain that you select only the nvme drive for the install

This isn’t an issue at this point because I physically disconnected the second drive.

and tell it to use the entire drive and wipe out all existing partition data during the setup.

I do this, I let it delete all existing partitions.

It actually sounds to me like it may have some remaining part of a prior install in the partition table that is confusing the boot loader during the install. If that is the case then making certain that it wipes out all existing partition data and completely rebuilds it should help

That seems plausible, but I wouldn’t know how, because apart from my previous attempts at wiping the drive with Disks, I just did your steps with fdisk, but the bootloader again fails to install. (Note: I did reboot before attempting to wipe the table with fdisk)

I noticed it fails twice though, the first time because it failed to remove old efi boot entry, the second time because it fails to set new efi boot target.

message: Failed to remove old efi boot entry. This is most likely a kernel or firmware bug.
exception: Failed to remove old efi boot entry. This is most likely a kernel or firmware bug.

I have finally found the solution. I don’t know how I didn’t come across this when I was trying to install Fedora last time.
I found the solution via a Reddit discussion which quoted from and linked to the Arch wiki. As it turns out, the UEFI had run out of space and I had to remove a bunch of dumpfiles.
Run rm /sys/firmware/efi/efivars/dump-*
It works now.