Last active
March 10, 2019 10:00
-
-
Save kokoye2007/7c7b3c54eea2cdf44650ad675dc92295 to your computer and use it in GitHub Desktop.
How to reinstall grub2 efi bootloader on ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#hd-efi=/dev/sda1 | |
#hd-root=/dev/sda2 | |
#hd-hdd=/dev/sda | |
[ -d /sys/firmware/efi ] && echo "EFI boot on HDD" || echo "Legacy boot on HDD" | |
sudo mount $hd-root /mnt | |
#if UEFi | |
sudo mount $hd-efi /mnt/boot/efi | |
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done | |
sudo chroot /mnt | |
grub-install /dev/sda | |
update-grub | |
#grub-install error | |
#Installing for i386-pc platform. | |
#grub-install: warning: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible. | |
#grub-install: error: embedding is not possible, but this is required for cross-disk install. | |
#try on live boot | |
parted $hd-hdd set 1 bios_grub on | |
parted $hd-hdd print | |
#retry in chroot | |
grub-install /dev/sda | |
update-grub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment