Restore Linux after Windows installation

This is a tutorial on how to restore Linux after windows installation.  Linux bootloader is GRUB2. You had a dual boot system on which you have re-installed windows. As you may know, the windows bootloader is aggressive. It overwrites the GRUB with its own bootloader. And as a result, you will not be able to access the old Linux installation. One workaround for this is to use an application called boot-repair. It may work in most cases. But for some users, it may not work. This is for those users who were not able to restore GRUB with boot-repair. This is a solution originally found on the askubuntu forum. It has helped me do this and I found it extremely useful. So, I’m posting it here as a more descriptive guide on how to restore Linux after windows installation.

Link to the answer I found on the forum:

Things you will need for this:

  • A live Linux CD or a live Linux USB drive

1. First, boot into Linux using the live USB or CD.

2. Open disk manager application to find the name of the drive on which you have installed the Linux previously. Say it’s sda3.

3. Open the terminal and execute the following command:

sudo mount /dev/sda3 /mnt
Instead of sda3, use the name of the drive name of your Linux installation

4. Next, execute the following command:

for i in /sys /proc /run /dev; do sudo mount –bind “$i” “/mnt$i”; done

It is for mounting the other Linux folders

5. If yours is a UEFI system, execute the following code also:

sudo mount /dev/sda1 /mnt/boot/efi

6. Change your root directory into the drive which is mounted as mnt (in this case, your Linux installation drive)

sudo chroot /mnt

Supply your login credentials of your earlier Linux installation.

You’re logged into the system now.

7. Execute the following commands one by one:

grub-install /dev/sda

Now, exit the terminal and reboot the system. Remove the live Linux medium from your device. You will be able to access your GRUB bootloader now.

Leave a Reply