0

I reinstalled Windows 8 yesterday. My mistake was deleting the EFI partition, so the entries for Ubuntu have gone. Now, I have lost Grub and my PC boot Windows automatically. There's any way to push the ubuntu entry to the EFI partition to boot Ubuntu again?

1
  • You should be able to use Boot-Repair, but I do not think the auto fix will be enough. In advanced run the full uninstall/reinstall of grub which should then recreate the ubuntu efi entry.
    – oldfred
    Dec 20 '14 at 4:41
0

The EFI partition just contains a FAT filesystem, so you can mount it, create a directory /EFI/ubuntu and copy /usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed into /EFI/ubuntu/grubx64.efi and /usr/lib/shim/shim.efi.signed into /EFI/ubuntu/shimx64.efi. Now if your nvram boot entry was deleted,m you will need to use efibootmgr to create another. One real benefit of UEFI is that the bootloaders are just files which may be copied around. The other file you will need is a copy of grub.cfg, either the "real" one from /boot/grub/grub.cfg, or a 3 line stub which pulls in the real one, looks like the below, adjust devices as needed:

search.fs_uuid 4e9797fa-2b51-4c8f-9a5c-37ee2cbf88ad root hd0,gpt7 
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

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.