Efibootmgr + nvme: How to create entry with custom label

Continuing the discussion from Modify EFI Boot Name:

I am trying to follow the above with my notebook. But I cannot make it work.

# efibootmgr -v
BootCurrent: 0003
Timeout: 0 seconds
BootOrder: 0003,0002,0000,0001,2001,2002,2003
Boot0000* Windows Boot Manager	HD(1,GPT,ff5df2d1-a769-401e-b303-1dc1a9ca1aff,0x800,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.}...b................
Boot0001* HDD2: KINGSTON RBUSNS8154P3256GJ1	PciRoot(0x0)/Pci(0x13,0x0)/Pci(0x0,0x0)/NVMe(0x1,00-26-B7-68-3F-03-51-E5)/HD(5,GPT,406d9776-8b8b-401f-986b-9532e5ac723a,0x15af3800,0x100000)RC
Boot0002* Fedora	HD(8,GPT,68968898-0578-4a42-989c-22274210019d,0x157f3800,0x100000)/File(\EFI\fedora\shim.efi)RC
Boot0003* Fedora	HD(5,GPT,406d9776-8b8b-401f-986b-9532e5ac723a,0x15af3800,0x100000)/File(\EFI\f36\shimx64.efi)
Boot2001* EFI USB Device	RC
Boot2003* EFI Network	RC
# lsblk -f
│    vfat   FAT32 ESP   3660-01FE                                           
│    ntfs         Acer  F4FE60AEFE606B36                                    
│    ntfs         Recovery
│                       B83261343260F8B0                                    
│    vfat   FAT32       82CC-B5DD                               489M     4% /boot/efi
│    ext4   1.0         6c1ead2c-7d81-4670-8151-4ed5e0f160a8  691.8M    22% /boot
│    btrfs        fedora_localhost-live
│                       71436bba-1309-48b7-87e5-61b23234df66   35.3G    42% /home
│                                                                           /
│    vfat   FAT32 efi35 98DE-7211                                           
     ext4   1.0   boot35

I want to duplicate Boot0003 with a different label “f36”. Then remove the old one once booted OK.

I have done similar once successfully when using SATA devices. But for NVME, it is new to me.

It should be same:

sudo efibootmgr -c -d /dev/nvme0n1 -L <LabelName> -l \\EFI\\<FolderName>\\shimx64.efi
<LabelName> : the name we want to show on BIOS boot list.
<FolderName>: folder name where `shimx64.efi`  placed under EFI folder.

Notice we add new parameter -d that pointing the root of where the EFI partition located. In your case nvme0n1.

1 Like

Thank you @oprizal very much for the hints:

I got it using

#efibootmgr -c -d /dev/nvme0n1 -L f36 -l \\EFI\\f36\\shimx64.efi -p 5

“-p 5” is added to specify the partition number

Please edit your reply so that I can mark it as the solution.

1 Like

I mark your reply as solution. No problem. Btw I believe we need to using -p 5 if we have more than one EFI partition (and it is possible) in current system.

1 Like

Thank you for this. I’m amazed the Fedora installer doesn’t do a better job of this. I got sick of having 5 different Fedora drives all marked “Fedora” and finally cleaned them up. This is especially painful with HP firmware that constantly reorders the EFI entries every boot for whatever reason.

1 Like