Repairing a FUBAR'd Master Boot Record

If you have a MBR-related issue that fixmbr or fdisk/mbr will not repair, read on. Its long, its tedious, its down-right harsh and a technical blood bath, but the steps are outlined clearly, and you will not lose a single byte of data along the way. No need to backup, no need to format, just one hell of a splitter headache when you are done.

Requirements: 1) XP/2k/2k3 CD ---OR---- a boot disk for ME or 98 (you can get it from http://BootDisk.com/) 2) A Linux install CD (We will not be using Linux anywhere though, you can use any Linux that you want. Gentoo is tiny) 3) A tub of coffee to keep you awake and kicking!

Part I: The Problem and the Failures

Over the past two days I suffered my biggest MBR-related problem - ever.

Apparently somewhere along the way the Mac OS X Boot Loader (for MacIntels, via Darwin), the new Vista Boot-loader, Grub (for Fedora Core 4), the standard Windows boot-loader (for everything else), and Acronis OS Selector (just trying it out), conflicted with one another, and I found myself with an MBR that would not load.

There are two types of crashed MBRs. The first is commonly seen after being struck by a boot-sector virus, and is identified by a boot message "OS Not found. Please insert system disk." or something along those lines. That message comes from the BIOS, and changes from mobo to mobo. The solution is to run a anti-virus program or to rebuild partition data.

The more troubling form of MBR is the one I experienced. It occurs when the first 512 sectors of the drive, which are reserved for the MBR are changed and mixed up. The symptom is a blank screen: after the BIOS loads, and transfers the startup call to the MBR, the MBR does not have a programmed step for it to take, and simply hangs.

After scouring the web for about 32 hours, I realized that every single website without fail pointed me towards trying

a) fdisk /mbr or booting from the XP CD and typing fixmbr; b) using fixboot (from XP CD Boot) in conjunction with fixmbr; c) using Xfdisk to repair the MBR; d) using Acronis OS Selector to uninstall/repair the MBR; e) using dd on Linux to completely wipe the MBR and start all over; f) restoring MBR from a backup.

In this particular scenario, I had over 70 GB of data on my affected HD, and backing it up was not really an option (in order to format). The first thing I tried before reading anything was fixmbr from the XP CD (it and fdisk /mbr are the same). Apparently the Acronis Boot Loader does not like to be removed the normal way: the entire MBR Boot Loader section was ruined by this one step.

I was directed to Xfdisk from Wilder's Security Forums, but unfortunately my previous step with fixmbr ruined my chances with that program. From another computer I attempted to install Acronis OS Selector again (after attaching the affected HD to there), and though it claimed to be installed, it was useless. I used the Acronis Recovery CD, but it was useless.

Devoid of all other options, I was left to discover something on my own....

Part II: The Fix

[This section has been converted to a page for easier accessibility. It can be viewed here.]

-CG



Leave a Reply  •  About to Ask for Help?  •  Subscribe to Our Feed

28 Responses to “ Repairing a FUBAR'd Master Boot Record ”


  1. 1John GaltNov. 3rd, 2005 at 10:35 pm

    I noticed that in your original attempt to fix this you never mentioned using 'fixboot' to try along with fixmbr.

    Whenever I have had MBRs go bad to the point that I cannot boot anything (usually a triple boot of Linux Linux and XP) I have had to issue both fixboot as well as fixmbr from the recovery console on the XP CD. In both cases, I have issued 2 of each, staggering them, so:

    fixmbr [ENTER] fixboot [ENTER] fixmbr [ENTER] fixboot [ENTER]

    This has solved my problems every time - even when I delved into LILO once with a system that had XP and a GRUB based boot for Fedora Core.

  2. 2Computer GuruNov. 3rd, 2005 at 10:46 pm

    My apologies. I tried it, and more than twice ;)

    I must have done fixboot and fixmbr and bootcfg /scan and bootcfg /rebuild 10 times :)

    Thanks for the note. I am updating the post right now ^*^

  3. 3Computer GuruNov. 3rd, 2005 at 10:50 pm

    Also note, Grub and Lilo install within the the first couple of sectors: the area that fixmbr repairs. Mac OS X Boot loader, Bootsector Virii, and Acronis OS Selector, as well as script/parition editing errors many times operate outside of that range. This was some of the excessive stuff that I did not mention in the post.

    Grub and LILO were developed to work side-by-side with NTLDR, while OS X most certainly was not, and Acronis has issues all over (but still is the most powerful)

  4. 4John GaltNov. 3rd, 2005 at 10:58 pm

    Thanks for the clarification. I am glad to see that you are adding to the steps taken section. Also, I did not take into account that, as you said, just because GRUB and LILO only affect a minute amount of the beginning of the MR that Acronis / OS-X would not be so nice / friendly / cooperative.

    Of course, the obvious was spelled out for me when you mentioned the 512 K barrier above in the post - but I forgot about it when making my original comment.

    Anyhoo, cheers on an extensively written (and well developed) guide.

  5. 5DominicNov. 7th, 2005 at 7:40 pm

    Following my own Fubared MBR experience, I concluded theall-around easiest thing to do, if you're an existing Grub user, is to burn Grub to a CD via the eltorito protocol, so no matter how badly you mangle the MBR, you still have a working Grub.

    Of course, this does depend on your PC supporting it, but it works for me :)

  6. 6Computer GuruNov. 7th, 2005 at 7:45 pm

    Great tip, however, notice that it does not actually solve anything. It allows you to enter Linux or Windows or Whatever, but your MBR is still ruined, and needs to be cleared and re-installed with the steps outlined above.

  7. 7TwigNov. 8th, 2005 at 3:02 pm

    How odd that having just had the exact same problem 2 days ago i find this, an actual walk through for fixing the problem.

    It just so happens that i did the exact same as in your walk through and it worked perfectly for me, i have my windows partition booting again.

    Never again will I dual boot.

    The acronis software must of played a part in it aswell, never again with that aswell.

  8. 8Computer GuruNov. 8th, 2005 at 3:09 pm

    Thanks for dropping by, Twig. Yeah, Acronis was the guilty party in this case.. Their BootLoader (in order to provide the amazing functions and sleekness that it does) is larger than the standard, which makes it almost impossible to fix. Glad to have some verification of it working on yet another PC.

    Please, if anyone has followed this guide, post a comment, I'd like to know what worked and what didn't for you.. (And if it REALLY saved your life... feel free to consider donating :P)

  9. 9mattDec. 1st, 2005 at 8:51 am

    i have a pc with grub remaining in the MBR. it wont load my windows partition because its looking for a partition pmagic destroyed. i cant figure out how to clear the MBR. i tried the xp cd with the R option, but as soon as I go to hit R, the computer restarts. i tried fdisk /mbr but fdisk reports that it sees no fixed drives. i was going to try to use boot magic but cant find that cd. i dont know how i can possibly clear my MBR if windows and fdisk cant see the drive. pmagic does in fact see the drive. i do not want to erase my partition by reinstalling linux. will toms rb floppy help?

  10. 10Computer GuruDec. 1st, 2005 at 9:38 am

    You have to follow our guide to the dot, and wherever something fails, skip it. Namely, skip the XP CD in the beginning BUT use the xFDisk to get your PC back up and running....

    Then after you've done what you can, start our guide over (its always easier the second time around); and see if those steps you had to skip are any less troublesome the second time around after the other changes have been done.

  11. 11Larry CroyDec. 7th, 2005 at 12:12 am

    Thank you to everyone for all the posts. I stumbled across an easy fix, from experimenting around with various utilities over many days. I am offering this up in hopes it might help someone else. Perhaps someone more knowledgeable can work with this and explain it better. Also this may work only on my pc because of some fluke. I dont' pretend to understand it other than the possibility that MBRtool resizes the MBR section. Here is the background--I had installed Acronis 8.0 on a Win XP Pro pc with the required 2nd hard drive, for research & testing purposes. I uninstalled Acronis and removed the 2nd drive. Consequently the pc wouldn't boot and hung up at "veryifying DMA..." After much research, I decided to reset the ESCD settings--Extended System Configuration Data, which in the Award Bios is under PnP/PCI. This reset allowed the pc to boot past the Verifying DMA... hangup. But now it hung at Boot from CD... Then using the MBRTool from the UBCD (Ultimate Bootable CD), I went to the File System utilities and loaded the MBRTool, accepting the defaults. I then used option 1 and created a backup. I then used option 4 and restored from the backup I had just created. I was then able to reboot into XP Pro.

  12. 12Computer GuruDec. 7th, 2005 at 12:43 am

    Hi Larry... Thanks for sharing this with us... My team and I will look into this possible solution, its definitely far easier than what we have been doing lately.....

    BTW ESCD only involves resetting the saved IRQ data for PCI and Onboard Peripherals, so if you had troubles with your HD being detected or something it would make a difference.

    I think MBRTool may be the solution.. I'll look into it. In brief it can either be the same as fixmbr in XP Setup for its what we need :)

    Thanks for the heads up mate!

  13. 13pietJan. 31st, 2006 at 10:07 pm

    Great manual. It would have helped a lot with my big MBR-crash five years back. Since then, whenever I changed anything involved in bootloading I just dd-ed the MBR onto a mini-linux diskette. It sounds like a backupped MBR would have done it in your case as well. (Of course one should do that before crash.) I have no experience with Acronis, though. And... since I have a mac, I somehow do not feel the need for multiple systems anymore... :-)

  14. 14DiazMay. 30th, 2006 at 7:26 pm

    The link to the 'page' is broken, I need some help and this seems to be all I can find, I need the disk with windows on, and I can't get inot it, please either send me what is on the rest, or fix the link!!!

  15. 15Computer GuruMay. 30th, 2006 at 8:09 pm

    No need to get all tense. The link has been fixed. Please post support questions in the forums if you have any.

  16. 16WidAug. 21st, 2006 at 1:18 am

    I mangled my MBR today - had an XP partition & two Linux partitions with their swap files on a hard disk. Removed the Linux files with Partition Magic & tried to restore the MBR with FDISK /MBR - unsuccessful.

    I googled fixing MBR or something to that effect & found the XP CD Recovery Console procedure. I did the fixmbr, fixboot, fixmbr, & fixboot - it worked for me.

    Thanks

  17. 17mescJun. 14th, 2007 at 7:55 am

    Actually, there are two forms of dd while restoring the master boot record. The first scenario cleans the first 446 bytes and does not touch the partition table, the second one writes a 512 byte sector, and cleans the partition table. 

      Esp the first version might be of use to someone. 

     

  18. 18Computer GuruJun. 14th, 2007 at 10:06 am

    Yeah, I've been meaning to rewrite this guide with a nifty little custom application to automate this entire process - soon!

  1. 1 Fixing a Broken MBR at Ramblings of a Computer Guru Pingback on Apr. 5th, 2006 at 12:17 pm
  2. 1 Neowin.net > How to Fix a FUBAR'd MBR w/out Formatting Pingback on May. 4th, 2006 at 2:45 pm
  3. 1 OneAndOneIs2: Such simple things. . .(pt. 1) Pingback on May. 18th, 2006 at 10:56 am
  4. 1 PC hardware - General discussion - Q: Programs get sluggish? Pingback on Jun. 2nd, 2006 at 5:46 pm
  5. 1 Windows XP: triple boot Pingback on Jun. 25th, 2006 at 9:39 pm
  6. 1 Status-Q » Blog Archive » Using Linux to upgrade a Windows machine Pingback on Jun. 28th, 2006 at 10:49 pm
  7. 1 StumbleUpon Pingback on Oct. 27th, 2006 at 12:22 pm
  8. 1 Acronis OS Selector - BIG PROBLEM - Wilders Security Forums Pingback on Mar. 29th, 2007 at 10:40 pm
  9. 1 How does install recognise a previous version of XP - Windows Vista Forums Pingback on Jul. 1st, 2007 at 10:41 am
  10. 1 Gentoo Forums :: View topic - Failed Install of Win2k Renders Gentoo Unbootable Pingback on Aug. 17th, 2007 at 5:26 pm

Leave a Reply