Duplicate Fedora EFI files and UEFI BIOS entries

I’ve recently been messing around with my EFI partition to shell out the remains of a Windows 10 dual boot setup I had and move it to the start of my drive, all and all it went well, only bricked it twice. Anyway my Fedora is booting fine however I’ve noticed two boot entries in UEFI both for the same install of Fedora. I had a look in /boot/efi/EFI and there are two instances of the “fedora” folder, both containing shimx64.efi, one in /boot/efi/EFI/fedora and another in /boot/efi/EFI/EFI/fedora.

Most likely I just typoed while doing the cp operation to transfer the files to a dummy partition and then to the new EFI partition in the correct position I wanted it but I don’t know which one to delete or if it even matters since both entries are identical and boot fine

~$ sudo diff -s /boot/efi/EFI/fedora/shimx64.efi /boot/efi/EFI/EFI/fedora/shimx64.efi
[sudo] password for cryptic: 
Files /boot/efi/EFI/fedora/shimx64.efi and /boot/efi/EFI/EFI/fedora/shimx64.efi are identical

Running efibootmgr

~$ efibootmgr
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0002,0001,0004,0000
Boot0000* Fedora        HD(1,GPT,e8dca705-ce47-4a1e-a64d-541cdb2f3f0b,0x800,0x80000)/\EFI\FEDORA\SHIMX64.EFI
Boot0001* UEFI OS       HD(1,GPT,e8dca705-ce47-4a1e-a64d-541cdb2f3f0b,0x800,0x80000)/\EFI\BOOT\BOOTX64.EFI0000424f
Boot0002* Fedora        HD(1,GPT,e8dca705-ce47-4a1e-a64d-541cdb2f3f0b,0x800,0x80000)/\EFI\fedora\shimx64.efi
Boot0004* Fedora        HD(1,GPT,e8dca705-ce47-4a1e-a64d-541cdb2f3f0b,0x800,0x80000)/\EFI\FEDORA\SHIM.EFI0000424f

The only one im slightly confused about is Boot 0000 as the path is caps cased and there is no /boot/EFI/FEDORA/ folder.

Some clarity on what these are referencing and advice for what to do here would be much appreciated, thanks

I don’t think it matters whether the name of the fedora directory is in caps or lower case. If it matters then 0000 and 0004 both have all caps in the path name.

My system has all capt in the path name on both entries for fedora.

You seem to have booted from 0001, so we know that one is good; and the default appears to be 0002.

You can test each of those entries to confirm each is bootable by using
sudo efibootmgr -n 000X where X is the entry you wish to boot next.
If any fail to boot properly then it can be removed with
sudo efibootmgr -b 000X -B

If all are able to boot properly then it becomes entirely up to the users choice if they wish to remove any of those entries.

The pathnames are relative to /boot/efi so \EFI\FEDORA\SHIMX64.EFI refers to /boot/efi/EFI/FEDORA/SHIMX64.EFI on your Fedora system. Also it is a vfat file system and in good old msdos tradition it makes no difference between lowercase and uppercase letters.

Okay, fixed up the duplicate Shimx64.efi and just rm -r the /boot/efi/EFI/EFI dir as it wasn’t referenced at all and that’s done the trick, however removing Boot0004 (shim.efi) just has it come back on reboot.

Ah so that’s what makes it case-insensitive! Also was silently wondering why it was backslashed instead of frontslashed but it makes sense if it’s msdos formatting. Thanks :slight_smile:

and the .efi files are basically Windows .exe type files, also known as PE32+.