Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I am using a dual boot machine running Windows XP (Home) and SuSE Linux 9.0. Due to XP problems, I think I will have to do a complete re-install of XP (won't even start in Safe Mode). My Linux "side" is working fine, and I don't want to lose this. My understanding is that if I do a fresh install of XP, I will lose my current Master Boot Record. If this is so, than I will lose access to dual booting - and my currently working Linux installation. Can anyone tell me how to save my current Master Boot Record and then how to restore it once XP has been re-installed? This is all new territory for me, so the more details you can provide the better!
dd if=/dev/hda of=/dev/fd0 bs=512 count=1
This copies yout MBR to a floppy (don't copy back to hd this way). You can use that floppy to boot your Linux as if nothing happened. Then, after XP is installed, you can run 'lilo' or 'grub-install /dev/hda' to restore bootloader to hd.
The mbr also contains partition information, which you wouldn't want to copy, especially if the information is different (say a different hd or you changed your partitions). To copy back safely, you will have to modify the 'dd' command to skip 16 bytes of the mbr. Not sure if it's first or last though.
You do this all from a Linux prompt as root. For restoration you reinstall the bootloader, running 'lilo' for the LILO bootloader, 'grub-install /dev/hda' for the GRUB bootloader. This should put things back they way it was. The floppy you make with 'dd' will let you boot Linux even after the MBR is erased.
OK. So when I re-boot, I put the floppy created in step one in the drive, then boot. This boots me to SuSE Linux instead of XP. Once in Linux, I log in as root. Then I type in the GRUB-install command which restores the MBR, and on my next re-boot I should see the dual boot choice, allowing me to boot to XP or to Linux. Do I finally have it correct?