- Already installed linux partition for which Grub needs to installed or repaired.
- Patience and some terminal knowledge is helpful.
Assuming linux is installed in /dev/sda3
. This will be different for your system. Use Gparted program to check.
- Boot from the USB drive. Open a terminal with "Alt+Ctrl+T".
OS="/dev/sda3" EFI="/dev/sda1" MOUNT="/cdrom"
- Mount the partition.
sudo mount "$OS" "$MOUNT"
- Bind mount some necessary partitions from live USB environment.
sudo mount -t proc /proc "${MOUNT}/proc/" sudo mount --rbind /sys "${MOUNT}/sys/" sudo mount --rbind /dev "${MOUNT}/dev/"
- Chroot into the mount point.
sudo chroot "$MOUNT"
- Now we are in the environment of the actual linux installation. Usually Grub is installed in
/dev/sda1
. Hence we need to mount it.Thissudo mount /dev/sda1 /mnt
/mnt
is different than the one in the previous steps. This one belongs to the actual linux install. - Update grub and install.
sudo grub-install --efi-directory=/mnt /dev/sda # alternative # sudo grub-install --target=x86_64-efi --efi-directory=/mnt/ --bootloader-id=<some name>
- Finally, unmount partitions. In chroot environment:
In live USB:
sudo umount /mnt exit
sudo umount "${MOUNT}/proc" sudo umount "${MOUNT}/sys" sudo umount "${MOUNT}/dev" sudo umount "$MOUNT"
Reboot and enjoy.
Sources:
https://unix.stackexchange.com/questions/96977/grub-probe-error-failed-to-get-canonical-path-of-cow
https://superuser.com/questions/165116/mount-dev-proc-sys-in-a-chroot-environment