Grub repair on a dual boot with Windows

Grub 2 typically gets overridden when you install Windows or another Operating System. To make Ubuntu control the boot process, you need Reinstall (Repair/Restore) Grub using a Linux Live CD.

ROOT_DISK='/dev/sda2'
BOOT_DISK='/dev/sda1' # optional
DISK='/dev/sda'

mount $ROOT_DISK /mnt
mount $BOOT_DISK /mnt/boot/efi # optional

for i in /dev /dev/pts /proc /sys /sys/firmware/efi/efivars /run; do sudo mount -B $i /mnt$i; done

chroot /mnt
grub-install $DISK
update-grub

# don't forget to update UUID in /mnt/etc/fstab using blkid

Leave a Reply

Your email address will not be published. Required fields are marked *