grub-efi overwrites an existing grub*.efi file

Bug #1056101 reported by YannUbuntu on 2012-09-25
This bug affects 2 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)

Bug Description

On Ubuntu 12.04 (grub 1.99), grub-efi creates a /efi/ubuntu/grubx64.efi file, which is recognized as an entry in the UEFI firmware.

When you install two Ubuntu (let's say UbuntuA, then UbuntuB) in dualboot, UbuntuB will overwrite the /efi/ubuntu/grubx64.efi file (linked to UbuntuA) by a new /efi/ubuntu/grubx64.efi file (linked to UbuntuB).

if UbuntuB's /boot/grub/grub.cfg is damaged or erased, the user can't access neither UbuntuA nor UbuntuB.

UbuntuA creates its own entry (eg /efi/ubuntu/grubx64_uuidA.efi ), and UbuntuB creates another entry (eg /efi/ubuntu/grubx64_uuidB.efi ), so that if UbuntuB's /boot/grub/grub.cfg is damaged, the user can still access UbuntuA via the UEFI firmware.

YannUbuntu (yannubuntu) on 2012-09-25
description: updated
Phillip Susi (psusi) wrote :

Note that if the primary config file is missing or corrupt, the grub rescue shell provides enough functionality to direct it to the config file of the other install, allowing recovery from such a scenario.

Changed in grub2 (Ubuntu):
importance: Undecided → Wishlist
status: New → Triaged
Jeremie Tamburini (jeremie2) wrote :

Discovered the same problem on Ubuntu 14.04 and 14.10.

One of the worst thing is that a step of the installation (GRUB position in the "mount point" settings) is just broken and doesn't work properly with multi-boot systems. The last installed *buntu will be always set as the default system, even if you DON'T select /dev/sda for GRUB.

After every installation I have to use BootRepair to set the system that I wanted as the default one. Other wise I can leave everything as it is, with a secondary system set as default, but at every kernel update there's the need to run the secondary system to run the "update-grub" command...

As this bug seems to be quite old, I'm afraid that probably there isn't an easy solution.
Is there at least a easier/faster workaround?

Jeremie Tamburini (jeremie2) wrote :

Today I was updating one of the system (Lubuntu) on one of my test partitions.
The system wasn't the default one at the boot, but as the grub packages have been updated, after the re-boot I have discovered that it was set as the boot default system...

This bug creates problems even with the updates.

At least I have found a quicker workaround here
All you have to do is booting from the grub menu the *buntu system you would like as the default one and run this command:

sudo apt-get install --reinstall grub-efi-amd64

This might sounds obvious, but every time I was searching informations related to grub/uefi I always found instructions for external instruments such as boot-repair.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers