Why can't I restore my grub??

Asked by Melzy

Once again, I reinstalled Windows XP. So, I attempted reviving my grub using my Live CD of Ubuntu Desktop Edition. I just don't get it. I've done this before. I don't know what is wrong with what I'm doing now. Here's what I did:

>sudo grub
>find /boot/grub/stage1
 (hd0,0)
>root (hd0,0)
>setup (hd0)
>quit

Nothing happened. The grub wasn't revived. T_T

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu grub Edit question
Assignee:
No assignee Edit question
Solved by:
Melzy
Solved:
Last query:
Last reply:
Revision history for this message
Gilbert Mendoza (gmendoza) said :
#1

When booting from your Live CD, did you mount the Ubuntu root partition and use chroot before trying to reinstall grub?

Typically you can do the following:

Boot into Live CD...
sudo mount /dev/sda1 /mnt
sudo chroot /mnt
sudo grub-install /dev/sda
exit

Reboot, and if all is well, then you should have grub restored to your MBR. If you are using an LVM, your steps will be different so before going into that, let us know of your progress.

Revision history for this message
Melzy (melz-mirth) said :
#2

Sorry but it didn't work. It seems that it can't find dev/sda1 or something. T_T

Revision history for this message
Melzy (melz-mirth) said :
#3

Okay. I finally got what is wrong after a series of trial and error. I should use "setup (hd1)" instead "setup (hd0)". I wish someone could explain where these hdx are based on so that I won't be just guessing.