Tuesday, 18 June 2013

How to re-install grub to recover Linux after windows installation

1) Many times it happens that we have linux & windows both installed in out system. Suddenly windows crash and now no way but you need to reinstall windows. In this windows installation process , windows bootloder MBR replace the Linux bootloader grub. After installation , you can not see grub and directly windows boot. 

2) Let say we have another scenario where we want to install two system and we first installed Linux[By mistake :P].  Now you install windows and your Linux is gone.

In this kind of scenario , instead of reinstalling Linux[with loss of important files :( ] you can reinstall grub and make linux on action again. 
Given below are the steps to do it.

Step1: 

Download the SystemRescueCd ISO. Which is basically Linux Distribution for Linux system rescue. You can also download or use other Linux which can run command we are going to use in next steps. But SystemRescueCd ISO is something I use and it always work for me.

Download link for SystemRescueDisk is given below.

Step2:

Burn it on CD or on Pendrive and boot SystemRescueCd Linux.
I use LiLi tool to burn Linux on Pendrive. That works fine for me.

Download link for LILIis given Below.

Step3:

After booting RescueCd, open terminal
write command as per instruction

#fsarchiver probe simple

#mkdir /mnt/linux

#munt /dev/sda2 /mnt/linux
                      here sda2 is partition for root file system of installed linux
#mount -o bind /proc /mnt/linux/proc
#mount -o bind /dev /mnt/linux/dev
#mount -o bind /sys /mnt/linux/sys

#chroot /mnt/linux /bin/bash
#grub-install /dev/sda

#umount /mnt/linux/dev
#umount /mnt/linux/proc
#umount /mnt/linux/sys
#umount /mnt/linux/boot
#umount /mnt/linux


After This, Just Restart the system and Congratulation, You just got your linux System back.

No comments:

Post a Comment