Saturday, November 23, 2019

After Update Ubuntu 12.04 does no longer boot on a UEFI machine



I got a computer running Ubuntu 12.04 64bit with UEFI. Today (2013-09-21) I installed all updates that were available without carefully reading through the list (shame on me), since noone touched the computer for some weeks and the list was more than 100 items long...



I remember from another machine, that one of the updates changes the boot system on UEFI machines in order to always use shim, even if restricted boot is disabled.




Well, problem diagnosis is rather straightforward: Something went wrong with the bootloader update, although no error was given, and the Ubuntu entry went missing from the UEFI boot menu, making the computer try to boot in BIOS mode, of course failing. If I run efibootmgr from a bootable USB it only shows the BIOS boot mode for the HDD...



How do I restore the Ubuntu entry in the UEFI menu to make the machine bootable again?



A simpler solution than the one provided by soulsource is:




  1. Boot with an emergency disc in EFI mode. The Ubuntu installation disc should work for this.

  2. If necessary, install efibootmgr.


  3. Type sudo efibootmgr -c -d /dev/sda -p 1 -l \\EFI\\ubuntu\\grubx64.efi -L Ubuntu. Change grubx64.efi to shimx64.efi if you're booting with Secure Boot enabled. Change -d /dev/sda to your boot disk if it's not /dev/sda, and change -p 1 to the number of your EFI System Partition (ESP). (The command I provided assumes the ESP is on /dev/sda1, which seems to be the case based on the information you've provided.)



The Boot Repair tool can also fix the problem, but it will try to do more than simply restore the original GRUB entry. This opens the possibility for it to cause damage by accident, so if you're comfortable with issuing shell commands, I recommend running efibootmgr manually for this task.



It's also possible to do the same thing using the Windows bcdedit command or the EFI shell's bcfg command. The Installing rEFInd Manually section of my rEFInd documentation describes how to use these commands to register rEFInd with the firmware. You should be able to easily adapt these commands for GRUB.


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...