Restore Grub after Windows Install

Restore Grub after Windows Install: After installing Windows alongside Linux, the Windows bootloader overwrites the Grub bootloader. This results in not being able to boot into Linux, which is where a Grub fix comes in.

There are several different methods that can be used to restore Grub after Windows Install. The following section covers two of them. The first being a manual step by step method, and the second being a more automated approach. I’ve had great success restoring grub on all of my Windows 11 and Windows 10 installs using either method.

How to Restore Grub after Windows Install

To restore Grub2 after a Windows install:

  1. Boot from a Live Linux USB drive. You can use any Live Linux distribution for this, such as Ubuntu, Fedora, or Debian.
  2. Once you have booted into the Live Linux environment, open a terminal. For example; Ctrl+Alt+T
  3. Type the following command to list all the partitions on your system:
    sudo fdisk -l
  4. Identify the partition where your Linux operating system is installed. Note the partition name, for example, /dev/sda1>/code>.
  5. Mount the partition with the Linux operating system:
    sudo mount /dev/sdx1 /mnt

    Replace /dev/sdx1 with the actual partition name.

  6. Mount other necessary partitions:
    sudo mount --bind /dev /mnt/dev
    sudo mount --bind /proc /mnt/proc
    sudo mount --bind /sys /mnt/sys
  7. Chroot into the mounted Linux partition:
    sudo chroot /mnt
  8. Install the Grub bootloader:
    sudo grub-install /dev/sdx

    Again, replacing /dev/sdx with the actual device name of your hard drive. If you have more than one hard drive, make sure to select the one where the Linux operating system is installed.

  9. Update the Grub configuration:
    sudo update-grub
  10. Exit the chroot environment:
    exit
  11. Unmount the partitions:
    sudo umount /mnt/dev
    sudo umount /mnt/proc
    sudo umount /mnt/sys
    sudo umount /mnt
  12. Reboot your computer from the terminal.
    sudo reboot

How to Restore Grub after Windows Install – Boot Repair

To restore Grub after Windows Install, we can use boot-repair which is a simple tool that can be used to repair frequent boot problems such as a missing Grub Bootloader. Here’s how:

  1. Open a terminal Ctrl+Alt+T, type the following and then press Enter:
    sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update && sudo apt-get install boot-repair

    Press Enter and then Y to install.

  2. Next, type the following and press Enter:
    boot-repair

    When prompted, answer any questions regarding RAID etc and then wait for the tool to scan and detect boot partitions.

  3. Once the scan has finished, select Recommended Repair to allow boot-repair to do its thing and fix Grub bootloader by performing an automatic repair.
    Use boot repair to restore grub after windows install

If all went well, Grub should now be restored, and you should be able to boot into both Linux and Windows.