9/13/2007

Reinstall Grub using Ubuntu live cd

If you can't boot your machine when you have installed both linux and windows in the machine, your MBR may be corrupted. So you need reinstall Grub.

1. Boot into the live Ubuntu cd.


2. When you get to the desktop open a terminal and enter.

Code:
sudo grub
This will get you a "grub>" prompt (i.e. the grub shell). At grub>. enter these commands

Code:
find /boot/grub/stage1

Next, THIS IS IMPORTANT, whatever was returned for the find command use it in the next line (you are still at grub>. when you enter the next 3 commands)

Code:
root (hd?,?)
Again use the value from the find command i.e. if find returned (hd0,1) then you would enter root (hd0,1)

Next enter the command to install grub to the mbr

Code:
setup (hd0)
3. Finally exit the grub shell
Code:
quit
That is it. Grub will be installed to the mbr.

4. When you reboot, you will have the grub menu at startup.

0 comments: