Ubuntu / Linux news and application reviews.

When you install Linux on your computer and then install Windows, the Grub will be deleted and you won't be able to boot into Linux anymore.


Here is how to fix (restore) the GRUB after such a situation:

1. You will need a Live CD with any Linux distribution. Insert the live CD of Ubuntu for instance, and boot from the CD.

2. As soon as the computer boots and the Live OS starts, go to Applications > Accessories > Terminal.

3. Now you have to recover the Grub for which you need to write (or paste) the following commands into the terminal (only what's bold, the text between the brackets is just the explanation of the command):

sudo grub

find /boot/grub/stage1 (This searches for the boot partition. It will give you a result which you'll have to copy for the next command)

root (hd0,0) (Replace hd0, 0 with the value obtained in the previous command)

setup (hd0) (This will install the grub)

quit (to exit.)

The next time you reboot, you can access your Linux box again.