XP: Repair or fix master boot record using recovery console

Contributor Icon Contributed by qmchenry Date Icon June 30, 2004  
Tag Icon Tagged: Windows installation

Problems with the master boot record (MBR) of a system may prevent the system from booting. The MBR may be affected by malicious code, become corrupted by disk errors, or be overwritten by other boot loaders when experimenting with multiple operating systems on a host. This recipe describes one method of repairing the MBR for an XP host using the recovery console.


Boot with the XP installation CD.

When prompted, press R to repair a Windows XP installation.

If repairing a host with multiple operating systems, select the appropriate one (XP) from the menu. If you have only one operating system, enter 1 to select it.

Enter the administrator password if prompted.

To fix the MBR, use the following command:

fixmbr

This assumes that your installation is on the C:\ drive. You will be presented with several scary warning lines the reading of which will make you want to say no. Microsoft is exceptionally vague regarding the conditions under which fixmbr can cause problems although they are clear about the consequences (losing all data on the hard drive), so use this at your own risk.

Type y and ENTER to fix the MBR.

Type exit to leave the recovery console and reboot.

Previous recipe | Next recipe |
 

Viewing 22 Comments

    • ^
    • v
    Just like to say thanks! I installed my slave drive in a friend's Compaq Presario and it wouldn't work. Not only that, when I removed it and reset the jumpers etc as they were, the PC lost it's MBR and wouldn't start up at all...nightmare.

    So after 3 hours of trying all manner of cable configurations, jumper settings and BIOS options I logged on my own PC and looked for help andthis is the first page that I clicked on.

    I followed all steps above, (Luckily there wasn't an administrator's password as he didn't know it anyway,) and viola! PC back to normal. Thanks for the help, it saved me a lot more embarrassment!
    • ^
    • v
    this was great advice i really appreciate it and it really helped me alot and i would just like to thank u
    • ^
    • v
    <ul id="quote"><h6>Stevieboy wrote:</h6>Just like to say thanks! I installed my slave drive in a friend's Compaq Presario and it wouldn't work. Not only that, when I removed it and reset the jumpers etc as they were, the PC lost it's MBR and wouldn't start up at all...nightmare.

    So after 3 hours of trying all manner of cable configurations, jumper settings and BIOS options I logged on my own PC and looked for help andthis is the first page that I clicked on.

    I followed all steps above, (Luckily there wasn't an administrator's password as he didn't know it anyway,) and viola! PC back to normal. Thanks for the help, it saved me a lot more embarrassment!</ul>
    • ^
    • v
    Your advice worked. Thanks.
    • ^
    • v
    Thanks a million love ya
    • ^
    • v
    I attempted to install Yoper linux today and it rewote my MBR. Afterwards I wanted to boot back into windows but didn't have any luck. I've tried Win 2000, Win XP, trying to use the "fixmbr" and "fixboot" methods. I've tried to format the whole hard drive and also tried to make several partitions. None of these methods worked, I fear that I may have to install another hard drive just to put the masterboot record on it along with windows. Any suggestions?
    • ^
    • v
    does fixmbr work on SP2???
    I created password after installation but recovery console does not recognize it!! what now??
    • ^
    • v
    <ul id="quote"><h6>drneo wrote:</h6>I attempted to install Yoper linux today and it rewote my MBR. Afterwards I wanted to boot back into windows but didn't have any luck. I've tried Win 2000, Win XP, trying to use the "fixmbr" and "fixboot" methods. I've tried to format the whole hard drive and also tried to make several partitions. None of these methods worked, I fear that I may have to install another hard drive just to put the masterboot record on it along with windows. Any suggestions?</ul>
    I found that formating c: drive is not enought. Delete that prtition and create it again then format. good luck
    • ^
    • v
    I installed SP2 and added later password for administrator. Now I can boot with the new password. HOWEVER when booting from XP CD and trying to get into repair console I am asked for the password. I enter administrator password but it is rejected as wrong password. Can you help????
    • ^
    • v
    <ul id="quote"><h6>Anonymous wrote:</h6>I installed SP2 and added later password for administrator. Now I can boot with the new password. HOWEVER when booting from XP CD and trying to get into repair console I am asked for the password. I enter administrator password but it is rejected as wrong password. Can you help????</ul>

    use winternals admin pak boot disk (erd commander) to reset your admin pass :P
    • ^
    • v
    Could you please tell me how to fix my problem. i have 3 hdd's
    the first is 20gb with xp on it. the second is 160gb and it is divided in four partitions. i have xp on one of the partitions and the master boot record of this drive is corrupted- one of the partitions is not recognised(not the one with the xp). I've tried the fixmbr command but i don't know how to say which mbr it should repair. not typing anything doesn't work. please help... :(
    • ^
    • v
    I need help trying to repair XP Home Edition on a hard drive removed from a Compaq box and physically transferred to an IBM clone box. The Compaq's motherboard went South on us, and when we try to execute the repair mode of XP, so it may recognize the new processor, it is asking for an administrator password. The new BIOS does not have any password setup, so I assume that Compaq must have set up a password on the hard drive when recovery is needed.

    How can I bypass the administrator's password request? I have seen e-mails floating about this scenario but I have not seen any procedures listed. Unless I am in the wrong section of this web site.

    Thanks for any help you can provide me.

    Chief
    • ^
    • v
    Boot to a CD-ROM with a tool that has a administrator password recovery program on it.

    This recipe explains how to recover the admin password using this method.
    • ^
    • v
    <ul id="quote"><h6>Dexter-V wrote:</h6>Could you please tell me how to fix my problem. i have 3 hdd's
    the first is 20gb with xp on it. the second is 160gb and it is divided in four partitions. i have xp on one of the partitions and the master boot record of this drive is corrupted- one of the partitions is not recognised(not the one with the xp). I've tried the fixmbr command but i don't know how to say which mbr it should repair. not typing anything doesn't work. please help... :(</ul>

    The command fixmbr
    fixes only the master boot code.
    IN your case, there is no problem with this code.
    What you need to fix is the partition table information part of the mater boot record (MBR). There is only one MBR per hard disk.
    If you have already saved master boot record, use NT4 resource utility DiskSave.exe, or free savepart.exe utility (http://www.partition-saving.com). If you had not bothered to do that, which is often the case, as it had happeded to me, use another free utility testdisk 6.1. Create a boot diskdisc with it, and run the program. The program comes with good documentation.
    From the corrupted partion table, I managed to recover even Linux partitions along with fat32, and ntfs partitions. But before doing that I suggest you backup all important personal, downloaded, developed files you have all other partions that you can access now. So, you will not lose every thing if something goes wrong. To do this kind of recovery operations, a CDRW or DVD-RW is very useful.

    If you do not have Linux partions, and if you already have Norton Utilities (NDD.exe) on a Emergency disk/disc, that will also do automatic fixing of partition tables. NDD.exe runs only in pure DOS mode.

    I hope this helps.

    Ganesh
    • ^
    • v
    <ul id="quote"><h6>Chief wrote:</h6>I need help trying to repair XP Home Edition on a hard drive removed from a Compaq box and physically transferred to an IBM clone box. The Compaq's motherboard went South on us, and when we try to execute the repair mode of XP, so it may recognize the new processor, it is asking for an administrator password. The new BIOS does not have any password setup, so I assume that Compaq must have set up a password on the hard drive when recovery is needed.

    How can I bypass the administrator's password request? I have seen e-mails floating about this scenario but I have not seen any procedures listed. Unless I am in the wrong section of this web site.

    Thanks for any help you can provide me.

    Chief</ul>
    <span style="text-decoration:underline">Quickest method:</span>

    I am not quite sure what exactly is the problem. But, this may be a possible solution to it.

    If you have access to another hardisk with OS that is working with the working motherboard, set it as master, and the inaccessible one slave. If you can now access partitions on your problematic hard disk, backup all your files, and reformat it. Take out the other hard disk, restore the jumper setting on the concerned hard disk, and reinstall the OS.
    Depending on how much you have to backup, it can take from 2 hrs to a day.

    Good luck, Ganesh
    • ^
    • v
    <ul id="quote">ust like to say thanks! I installed my slave drive in a friend's Compaq Presario and it wouldn't work. Not only that, when I removed it and reset the jumpers etc as they were, the PC lost it's MBR and wouldn't start up at all...nightmare.</ul>

    There are ways to rebuild your MBR

    Rebuilding the MBR

    Using the Fixed Disk Editor in Micro-Scope, locate and read Cylinder 0, Head 0, Sector 1. This should be the location of the corrupt Master Boot Record. Press "M" to modify the sector and enter 0's for the entire sector, effectively wiping all the data from this sector. Press ESC, then "W" to write the data, and "Y" to confirm the write operation. Then exit the Fixed Disk Editor and select the Rebuild Master Boot Record menu option. Press "Y" to confirm this operation. The fixed drive now has a completely corruption-free MBR.

    Second way is to use some data recovery software. It will not build your MBR but at least you will get back all your data.
    I would suggest you Stellar Phoenix FAT & NTFS. Try the demo version to see what data you can get back. Download the demo from here
    Demo will show you the recovered data.
    • ^
    • v
    Doesn't work. Neither does the fixboot command using the same procedure. Receive only a flashing cursor, with no other functions. Actually, whenever I press a key I get a "beep." My XP boot discs, made as soon as I had the OS operational, are as useless as anything the brain dead programmers at M$ have ever thought of. Don't know what to do about any of it now.
    • ^
    • v
    I tried the procedure outlined, however,I have no administrative pass word, I never bothered with it as it becomes a nuisance , so I could not proceed, is there any way to get around it?
    Thanking you
    • ^
    • v
    its a good presentation can you add more stuff on this tutorial.
    infact it has helped me to fix computers with this related problem.

    from malawi city of mzuzu
    • ^
    • v
    so this deletes all of the filees off the computer?
    and also does it delete windows xp itself?
    • ^
    • v
    Thank you so much :_)
    • ^
    • v
    what about when its a spare drive no Operating system and you just want to retrieve the contents of a drive
    and NO I dont want to FORMAT IT