Rename Default Ubuntu UEFI Boot Entries

For some strange reason Ubuntu LTS server installer creates cryptic UEFI boot entries.

There are two and both are named just «ubuntu».

$ efibootmgr
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0000,9696,969B,969A,969D,969C
Boot0000* ubuntu
Boot0001* ubuntu
Boot9696* OpenCore
Boot969A  UEFI: PXE IPV4 Intel(R) Ethernet Connection (7) I219-LM
Boot969B* WDC PC SN720 SDAPNTW-256G-1006
Boot969C* Generic Usb Device
Boot969D* CD/DVD Device

This, naturally, raises questions about which entry does what and if those are some kind of duplicate entries, or what?

If we run efibootmgr -v, we can see that the two entries point to two versions of the GRUB bootloader: one that is compatible with SecureBoot (SHIMX64.EFI) and the other one is your standard and familiar GRUB bootloader (GRUBX64.EFI).

$ efibootmgr -v
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0000,9696,969B,969A,969D,969C
Boot0000* ubuntu HD(1,GPT,a750b0f4-2cb6-4a2d-a946-e67053ac6b2f,0x28,0x64000)/File(\EFI\UBUNTU\SHIMX64.EFI)
Boot0001* ubuntu HD(1,GPT,a750b0f4-2cb6-4a2d-a946-e67053ac6b2f,0x28,0x64000)/File(\EFI\UBUNTU\GRUBX64.EFI)

Luckily, we can give those entries better names.

Here’s how it’s done.

First, we need to delete existing «ubuntu» records.

$ sudo efibootmgr -v -b 0000 -B
$ sudo efibootmgr -v -b 0001 -B

Then recreate the entries.

$ sudo efibootmgr -c -d /dev/nvme0n1 -p 1 -L «Ubuntu 20.04 LTS (grubx64.efi)» -l «\EFI\ubuntu\grubx64.efi»
$ sudo efibootmgr -c -d /dev/nvme0n1 -p 1 -L «Ubuntu 20.04 LTS (shimx64.efi)» -l «\EFI\ubuntu\shimx64.efi»

The -d and -p flags tell efibootmgr where your ESP (EFI System Partition) is located. In this example, it is a first partition (-p 1) of /dev/nvme0n1 disk.

$ lsblk /dev/nvme0n1
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
nvme0n1     259:0    0 238.5G  0 disk
├─nvme0n1p1 259:1    0   200M  0 part /boot/efi
├─nvme0n1p2 259:2    0 191.7G  0 part
└─nvme0n1p3 259:3    0  46.6G  0 part /

Run efibootmgr again to see the new boot entry names.

$ efibootmgr
BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0001,0000,9696,969B,969A,969D,969C
Boot0000* Ubuntu 20.04 LTS (shimx64.efi)
Boot0001* Ubuntu 20.04 LTS (grubx64.efi)
Boot9696* OpenCore
Boot969A  UEFI: PXE IPV4 Intel(R) Ethernet Connection (7) I219-LM
Boot969B* WDC PC SN720 SDAPNTW-256G-1006
Boot969C* Generic Usb Device
Boot969D* CD/DVD Device

Reboot and enter your UEFI boot manager. You should be able to see the new and more informative boot entries.

Screen Shot 2022-07-28 at 8.26.51 AM.png

Оставьте комментарий