Ubuntu – How to change the names of items in the EFI/UEFI boot menu


I use Ubuntu 18.04 on my computer. This Ubuntu installation appears as ubuntu at system EFI boot menus.

I also have a external USB storage that has a EFI Ubuntu installation. This external USB storage also appears with the name ubuntu at system EFI.

I see two ubuntu menus at system EFI boot menus when external USB storage is attached. This makes it hard to figure out which ubuntu menu item points to the Ubuntu installation on the computer, and which one points to the Ubuntu installation on the external USB storage.

How I can change the EFI boot label to something different?

For example, how can I change ubuntu EFI boot label on the external USB storage to appear as External Ubuntu at system EFI boot menus?

The Ubuntu on my external USB storage has its own EFI partition.

This question is different from How to safely change OS name in grub boot menu?

This question is about how to change the Efi Boot name that appears in the EFI Firmware setup and not in the GRUB boot menu.

Picture of EFI Firmware setup

Best Answer

I had exactly the same issue with Ubuntu 18.04 on my Lenovo S540: two similar-looking "ubuntu" entries in the boot menu, one for the system on the local drive, and another for the system on the USB drive.

I saw a number of discussions suggesting to remove ambiguous boot entries and to re-create them with efibootmgr:

Something like this:

efibootmgr --create --disk /dev/sda --part 1 --label "My new label" --loader \\EFI\\ubuntu\\shimx64.efi

These discussions convinced me this technique should work, and it did the job for me. The entry for the USB drive does not disappear upon drive disconnection, and it is even listed as available boot option when the external drive is missing. It still may be that different EFI firmware flavors (Lenovo vs whatever) behave differently in this respect...

Continuous exercising with renaming these entries motivated me to write an automation tool :) , that is now available as https://github.com/s-n-ushakov/rename-efi-entry

Please feel free to try and comment...