Linux - General This 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. |
| Notices |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
04-05-2004, 12:29 PM
|
#1
|
|
LQ Newbie
Registered: Dec 2003
Posts: 10
Rep:
|
Backup/Restore Master Boot Record
Hello -
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!
Thank you!
|
|
|
|
04-05-2004, 12:40 PM
|
#2
|
|
Guru
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194
Rep:
|
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.
|
|
|
|
04-05-2004, 12:50 PM
|
#3
|
|
Senior Member
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028
Rep:
|
If you would like to make backup file of your MBR then you could run
dd if=/dev/hda of=<some directory>/MBR.img bs=512 count=1
aaa Why won't it work to reverse the floppy command?
|
|
|
|
04-05-2004, 01:18 PM
|
#4
|
|
Guru
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194
Rep:
|
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.
|
|
|
|
04-05-2004, 01:36 PM
|
#5
|
|
LQ Newbie
Registered: Dec 2003
Posts: 10
Original Poster
Rep:
|
Thanks aaa and ugge.
aaa - Can you provide me with a bit more detail on the restore? I assume I do this from a DOS prompt. What exactly do I need to type in?
Will this just copy the GRUB information back just the way it was, so the next time I boot I will be presented with the dual boot choice?
Thanks again. Sorry I need so much hand-holding here. I'm not experienced in this area. It took me a while to get Linux running, and I just don't want to have to do it all over again!
Thanks again!
|
|
|
|
04-05-2004, 01:50 PM
|
#6
|
|
Guru
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194
Rep:
|
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.
|
|
|
|
04-05-2004, 02:04 PM
|
#7
|
|
LQ Newbie
Registered: Dec 2003
Posts: 10
Original Poster
Rep:
|
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?
- a million thanks!
|
|
|
|
04-05-2004, 02:12 PM
|
#8
|
|
Guru
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194
Rep:
|
Yes.
|
|
|
|
04-05-2004, 02:35 PM
|
#9
|
|
Moderator
Registered: Aug 2002
Posts: 10,685
|
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 07:52 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|