Get back the Dual boot (Linux & Windows)

When we have a dual os in our system like Windows & Linux. Its more likely that sometimes we are forced to re-install windows. Once the Windows is re-installed, we could not more get the option to boot into Linux. Actually the MBR would have been over-written by new Windows and we have no other choice to boot into Linux.
Here’s a solution to get back the dual boot option if we are using grub.

1) Boot through the Linux #1 installation CD.

2) Once booted, you will end up in a ‘boot:’ prompt

3) Type ‘linux rescue’ (without quotes) and press Enter.

4) Follow the intial steps provided.

5) Finally, you will reach the linux command prompt.

6) Type the following in the prompt.
prompt# chroot /mnt/sysimage
prompt# /sbin/grub-install /dev/hda
prompt# exit
prompt# exit

7) Now the system will reboot automatically.

8) Remove the installation CD from the CD Drive and boot through the hard disk.

9) Now you will see the options of OS to boot.

Note: /dev/hda-refers to the harddisk connected to the system. It will differ with respect to the way your hard disk is connected.
For Example:
it will be
/dev/hda – if the hard disk is connected as Primary Master
/dev/hdb – if the hard disk is connected as Primary Slave
/dev/hdc – if the hard disk is connected as Secondary Master
/dev/hdd – if the hard disk is connected as Secondary Slave

Hope this trick will be helpful for you.
But still, if you feel like not going through all this pain, do not install Windows :).

Advertisements

About this entry