website tracking
Logo
Japan
 
My Photo
Name: James Pearce
Location: Perth, WA, Australia

Powered by Blogger

Rescuing GRUB After Windows Reinstall
Saturday, July 21, 2007
Actually, you can do this to rescue GRUB after you wipe the MBR for any reason.

Windows will install the NT loader in the root of the drive, not the partition, so we need to tell GRUB to install there. Also, the typical method of chroot'ing often does not work, because the devices will not map (/dev breaks). Of course, this depends on which devfs you are using.

Anyway, the most reliable way I have found is too boot any linux LiveCD, open a terminal, and just do:

$ grub --no-floppy
> GRUB Version 1.0
$ root (hd0,0)
$ setup (hd0)
$ exit

That's it! The --no-floppy means don't look to the floppy for a boot sector (makes GRUB a little faster to load). Also, you may need to sudo the initial grub command depending on your live CD.

The mapping for hd0 to the linux devices, is it is the 1st hard drive i.e. hda or sda. The partition numbers are 0 based, so instead of hda1-4 you have hd0,0-hd0,3. Make sure you get the device correct!

0 Comments:

Post a Comment

<< Home