Return GRUB to MBR after Windows Install

blahsome

Senior member
Dec 4, 2000
258
0
0
My MBR is now occupied by GRUB of RedHat 8.0. It boots Windows XP or Linux. Now I'm trying to reinstall WinXP, which will overwrite my MBR.

I used to use LILO. After I reinstalled Windows, I would boot into Linux using the floppy boot disk and run /sbin/lilo to get LILO back into MBR. Is there a similar process for GRUB?

Thanks.
 

Tiger

Platinum Member
Oct 9, 1999
2,312
0
0
# grub You'll get a prompt that looks like this.
grub>
From there type root (hd0,x). Where x is the number of the boot partition on the first IDE drive counting from 0. Example, the first partition on the first IDE drive is (hd0,0), the second is (hd0,1).
Then, setup (hd0). This will install the boot record on the MBR.
Then, quit.

You need to make a grub bootdisk. Issue these commands from a terminal with a floppy in the drive.
#mke2fs /dev/fd0
#mount /dev/fd0 /mnt/floppy
#mkdir -p /mnt/floppy/boot/grub
#cp /usr/share/grub/i386-pc/stage1 /mnt/floppy/boot/grub
#cp /usr/share/grub/i386-pc/stage2 /mnt/floppy/boot/grub
#grub
grub> root (fd0)
grub> setup (fd0)
grub> quit

Once you get Linux up and running go to /boot/grub/grub.conf and make sure there's a stanza in there for Windows.
If not add one that looks like this.
title=windows
root (hd0,x) The x is the Windows partition, usually (hd0,0)
rootnoverify
chainloader +1

Save the file and you're done.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Grub + win9x howto

That may help you....

Probably the easiest thing would be to make a floppy bootdisk with grub or lilo, check to make sure that it works, install windows, make sure that works, then reinstalling Grub into the MBR to get everything back to normal. That's what I'd do...