How can I change the names of items in the EFI/UEFI boot menu?
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
:
- https://bbs.archlinux.org/viewtopic.php?pid=1215494#p1215494
- https://bbs.archlinux.org/viewtopic.php?pid=1083424#p1083424
- https://www.linuxbabe.com/command-line/how-to-use-linux-efibootmgr-examples
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...
When you run grub-install
on an EFI system, it will set the name of the EFI menu entry, by default to the grub_distributor config entry. On Ubuntu this is set in /etc/default/grub
(GRUB_DISTRIBUTOR=`lsb_release ...`
).
- Change
GRUB_DISTRIBUTOR
in/etc/default/grub
. - Run
update-grub
to update the GRUB configuration files. - Run
grub-install
to (re)install GRUB in the EFI menu - now with the new name. - You might have to manually remove the old EFI menu entries.