I encountered this issue when I upgrade the firmware of my Xubuntu box. Now, I would like to show you how to recovery the boot config. This demo is using Ubuntu 16.04 on Virtual Box.
- Get an installation CD or a flash drive with installer of Ubuntu 16.04 (You should have it when you install the Ubuntu first time). If you don't have it, get it from here.
- Boot up the system using the CD or flash drive. In GRUB, select "Try Ubuntu without installation"
- Then, you should be able to boot into a fresh Ubuntu, like
- Open a terminal and run "sudo su" to switch to root user.
- Now, we need to know where the EFI partition located. We can use "fdisk -l /dev/xxx" command to list out the paration, like:
Refer to the above screen, we know that the EFI partition is on the first partition of device "sda" (i.e. /dev/sda1). (Note: the actual location of the EFI partition on your box can be different from this demo.) - Then, we mount the EFI partition to verify if the Ubuntu GRUB loader is installed. To do this, mount the drive using command "udiskctrl mount -b /dev/xxx" and check if the EFI partition contains "EFI/ubuntu/shimx64.efi" file. E.g.:
- After the above verification, we have enough information to create the add the boot entry using the command:
efibootmgr -c -d /dev/xxx -p n -l '\EFI\ubuntu\shimx64.efi'
where "xxx" is the disk device contains the EFI partition, and "n" is the partition number. E.g.: