5

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

9
  • can you attach a pic please? – UnKNOWn Mar 15 '19 at 13:48
  • 2
    Old bug, not resolved. bugs.launchpad.net/ubuntu/+source/grub2/+bug/1561712 Your two entries are grub & shim from last installed Ubuntu. You currently cannot have two entries with default installs. But if external drive you can boot it directly, if you have ESP on external and move boot files/ESP to it as external drives boot from /EFI/Boot/bootx64.efi as fallback entry. And that goes by drive name. – oldfred Mar 15 '19 at 14:48
  • Thanks @oldfred for comments. Those two "Ubuntu" entries are not from same Ubuntu installation on same storage. The external drive is portable and independent. it has its own ESP. It can be booted on different computer. As soon as I boot from external device, it add its own "Ubuntu" entries to the list. Both "Ubuntu" entries works and point to right Ubuntu installation, they just have same name. My question is how I can change that "Ubuntu" entry to something different when I connect my external device to a different computer. – askquestion Mar 15 '19 at 15:01
  • Then link to duplicate should work. I have changed name, but with multiple ubuntu installs in one ESP different name shows up, but /EFI/ubuntu/grub is only file used to boot. If separate UEFI, then each should use the GRUB_DISTRIBUTOR= setting. Its just in grub and UEFI it really is a "efi_distributor" variable which we cannot reset to enable separate labels in one ESP. – oldfred Mar 15 '19 at 15:16
  • @oldfred I applied following after booting into external storage: sudo nano /etc/default/grub # GRUB_DISTRIBUTOR=lsb_release -i -s 2> /dev/null || echo Debian GRUB_DISTRIBUTOR="EXTERNAL UBUNTU" sudo update-grub After shutdown, replug and restart, again same second "Ubuntu" entry added to EFI firmware boot menu followed by displaying "EXTERNAL UBUNTU" when grub menu appeared after boot. The link to duplicate post only change the Ubuntu name when grub menu appear. It does not change the "Ubuntu" entry at system firmware Efi menu that displays before grub menu. – askquestion Mar 15 '19 at 16:17
3

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...

1
  • 1
    The GitHub page is nicely documented. – WinEunuuchs2Unix Nov 1 '19 at 12:38
2

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 ...`).

  1. Change GRUB_DISTRIBUTOR in /etc/default/grub.
  2. Run update-grub to update the GRUB configuration files.
  3. Run grub-install to (re)install GRUB in the EFI menu - now with the new name.
  4. You might have to manually remove the old EFI menu entries.
1
  • grub-install should be used with the --removable-option in OP's case. – mook765 Dec 1 '20 at 11:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.