GRUB Reinstall

Thomas Kaiser thomas at kaiser.linux-site.net
Tue Jul 5 21:25:39 UTC 2005


> will kill the MBR and GRUB will be gone.
>      My question is: How easy is it to reinstall GRUB and get the
> settings that I had before?
You could backup your MBR first.
For the first IDE drive: dd if=/dev/hda of=/somewhere/mbr.bin bs=512 
count=1 would do the trick. (But, don't change the partition table)

After that install XP and XP will boot fine, but you cannot boot linux 
anymore. Now, you need a linux boot/recovery/live disc/cd and put your 
backup of the MBR back to the disk. dd if=/somewhere/mbr.bin of=/dev/hda 
can do this. But now, XP is not booting anymore :-) (maybe it will boot 
if you had alredy the right entries in menu.lst). If not you have to 
edit your /boot/grub/menu.lst. Add something like this:
# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda1
title          Windows NT/2000/XP
root           (hd0,0)
savedefault
makeactive
chainloader    +1

But before you start to ply with this, make a grub boot floppy and test 
it before you do reinstall XP. I don't remember correctlly how to make a 
grub boot floppy, but google knows. If something goes wrong, you can 
boot from the floppy and point grub to your linux kernel to boot.

Regards, Thomas




More information about the ubuntu-users mailing list