- Boot live CD and open terminal.
- Connect to wifi and ensure that your resolv.conf has a good nameserver (e.g. you can `dig google.com`).
- $ sudo su -
- Use gdisk (or fdisk) to check which disk is your HDD. Mine was /dev/sda
- # cryptsetup open /dev/sda3 myroot ## You will need the passphrase for this.
- # lvdisplay ## Find the path of your root volume. Mine was /dev/ubuntu-vg/root
- # mount /dev/ubuntu-vg/root /mnt
- # mount /dev/sda2 /mnt/boot ## Required for doing update-grub later.
- # mkdir /mnt/boot/efi ; mount /dev/sda1 /mnt/boot/efi
- # for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt$i; done
- # cp /etc/resolv.conf /mnt/etc/ ## Makes the network available after chrooting.
- # modprobe efivars
- #chroot /mnt
- Add "deb http://au.archive.ubuntu.com/ubuntu/ trusty main restricted" to /etc/apt/sources.list
- # apt-get update
- # apt-get install efibootmgr=0.5.4-7ubuntu1
- # update-grub
- # ls /boot/efi/EFI/ubuntu ## Find the efi files that you might need. Mine was shimx64.efi & grubx64.efi
- # efibootmgr -c --disk /dev/sda --part 1 --loader '\EFI\ubuntu\shimx64.efi' --label 'Linux shim' ## Where ' --part 1' is your EFI partition number on '--disk /dev/sda'.
- # efibootmgr -c --disk /dev/sda --part 1 --loader '\EFI\ubuntu\grubx64.efi' --label 'Linux grub'
- # efibootmgr -v ## Verify the new records.
- Ctrl+D to leave the chroot.
- # umount /dev/sda1 # dismount EFI volume
- # umount /dev/sda2 # dismount boot volume
- # reboot
Thanks @addam-edgley et al! I was thrashing on this for most of last night but figured it out in the morning.
I had a slightly different experience (mainly encrypted root with LVM), so recording it in full for The People Of The Future™. This is very similar to Adam's post and the answer at http:// superuser. com/questions/ 376470/ how-to- reinstall- grub2-efi
- Boot live CD and open terminal. au.archive. ubuntu. com/ubuntu/ trusty main restricted" to /etc/apt/ sources. list 0.5.4-7ubuntu1 EFI/ubuntu ## Find the efi files that you might need. Mine was shimx64.efi & grubx64.efi shimx64. efi' --label 'Linux shim' ## Where ' --part 1' is your EFI partition number on '--disk /dev/sda'. grubx64. efi' --label 'Linux grub'
- Connect to wifi and ensure that your resolv.conf has a good nameserver (e.g. you can `dig google.com`).
- $ sudo su -
- Use gdisk (or fdisk) to check which disk is your HDD. Mine was /dev/sda
- # cryptsetup open /dev/sda3 myroot ## You will need the passphrase for this.
- # lvdisplay ## Find the path of your root volume. Mine was /dev/ubuntu-vg/root
- # mount /dev/ubuntu-vg/root /mnt
- # mount /dev/sda2 /mnt/boot ## Required for doing update-grub later.
- # mkdir /mnt/boot/efi ; mount /dev/sda1 /mnt/boot/efi
- # for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt$i; done
- # cp /etc/resolv.conf /mnt/etc/ ## Makes the network available after chrooting.
- # modprobe efivars
- #chroot /mnt
- Add "deb http://
- # apt-get update
- # apt-get install efibootmgr=
- # update-grub
- # ls /boot/efi/
- # efibootmgr -c --disk /dev/sda --part 1 --loader '\EFI\ubuntu\
- # efibootmgr -c --disk /dev/sda --part 1 --loader '\EFI\ubuntu\
- # efibootmgr -v ## Verify the new records.
- Ctrl+D to leave the chroot.
- # umount /dev/sda1 # dismount EFI volume
- # umount /dev/sda2 # dismount boot volume
- # reboot
Thanks again everyone - you saved my weekend.