A usual scenario all dual-boot (Linux and Windows) users face is when installing Windows after Linux; this causes MBR (the GRUB bootloader) to be overwritten
by Windows. Following this, the computer straight away boots Windows, without displaying the entries for the other installed operating systems-this is why it is always advisable to install Linux after Windows. However, even if you've encountered a situation where you've lost GRUB, you can fix it easily. Collect some GNUlLinux live CD like Knoppix and boot from it. If the live CD displays a GRUB menu, it is even easier. Press C to enter the GRUB command line.

Name:  overwriting.jpg
Views: 115
Size:  11.3 KB

The output of the find command in the above snippet says that it has found two Linux installations on the system. Now, in order to install GRUB from either of these Linux installations, run the following set of commands: That's it. Your Grub is now restored back into the MBR. Alternately, you can boot into the live CD and get a root prompt.What has to be done above is as follows:

mount the root device (fdev/sda5) to /mnt/jixroot. The devices currently available to the live system are then bound to /dev/ of the root partition (fdev/sdaS) at /mnt/ jixroot/dev. Finally, we temporarily change-root to the fllesystem at /dev/sda5 using the chroot command and execute grub-install to fIx MBR. (Of course, don't forget to change /dev/sda5 to the correct Linux partition on your system.