Re-writing Linux to the MBR
Hi there,
I have a dual boot system, Linux RH9 and WinXP Home, I want to change to WinXP Pro, but if I install it, it will rewrite the MBR, and I'll only be able to access Linux through my boot disk... How can I rewrite Grub to the MBR? Is it possible? Thanks for your help! :) |
Yep its possible. Boot with your boot disk. Get to a console and as root type:
grub --wait a while as it probles the bios-- root(hdx,x) --Your /boot partition or / if you haven't got a boot partition-- setup(hd0) quit Now reboot and everthing should be back in order. |
Great stuff! Thanks so much for your help! :)
|
I'm about to install win2k and run dualboot. But how do i make a bootdisk in linux? Oh, and one more thing... I use lilo, how do i rewerite the MBR then? The same way as grub?
|
To make a boot floopy for your machine ( And it will ONLY work for your machine ) go into /etc/lilo.conf and comment out the line boot=/dev/hda and add the line boot=/dev/fd0 So it looks like this:
#boot=/dev/hda boot=/dev/fd0 Now save it. Put a blank floppy in and as root type /sbin/lilo. This will create your boot floopy. Don't forget to change things back after its finished. To restore LILO to the MBR simply execute /sbin/lilo again. Allthough you will need to alter the lilo.conf for you new OS. |
Another way to make a boot floppy is at the command line type mkbootdisk kernel version and your good to go.Of course substitute kernel version for your own actual kernel version.
|
mkbootdisk can also be mkboot, but its implentation varies quite a bit. If it exists at all.
|
I did what you said leonscape, with the bootdisk, but when i checked the floppy after i'd typed "/sbin/lilo", there was nothing on the disk. I'm just wondering if that's correct ;)
|
Usually, Its simply written the first block of the disk as a bootloader. Try Booting with it. ( Which you should always do to make sure boot disks works, I've been burned by bad disks ).
|
Conversely,
In case I remove linux from my system, is it possible for me to remove LILO from the MBR? and if yes, then how? |
You sure can, in windows type "fdisk /mbr" without the quotes, and you should be good to go.
|
Thanks very much, I used the FIXMBR from the recovery console, and it worked too !!
|
All times are GMT -5. The time now is 06:12 AM. |