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 |
 
  • Stevieboy
    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!
  • Anonymous
    this was great advice i really appreciate it and it really helped me alot and i would just like to thank u
  • Precision Drilling Intern
    <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>
  • Guest
    Your advice worked. Thanks.
  • Anonymous
    Thanks a million love ya
  • drneo
    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?
  • SEARCHY4
    you do know that format basicly means erase.so you erased your whole drive and everything on it.you lost it all.only thing to do now is re install windows.sorry for the bad news
  • destrie
    does fixmbr work on SP2???
    I created password after installation but recovery console does not recognize it!! what now??
  • obernhardt
    I booted from a second HD with recovery console, enter his recovery console and used fixmbr from here
  • Dale L.
    Automatic logon

    You can enable automatic logon to the Recovery Console. Run regedit from the Run command and go to this registry key: by default, the level is set to "0" - simply change it to "1" and you will never be prompted for the administrator password...

    HKEY_LOCAL_MACHINE\SOFTWARE\
    Microsoft\Windows NT\CurrentVersion\
    Setup\RecoveryConsole
    SecurityLevel
    DWORD = 1
  • halasz
    <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
  • Anonymous
    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????
  • Anonymous
    <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
  • Dexter-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... :(
  • Anonymous
    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
  • davak
    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.
  • Anonymous
    <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
  • Anonymous
    <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
  • Anonymous
    <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.
  • mbnosera
    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.
  • kujirasan
    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
  • harryg
    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
  • Ryan
    so this deletes all of the filees off the computer?
    and also does it delete windows xp itself?
  • Thank you so much :_)
  • icemanx
    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
  • paulgmw
    i need help!!! i have a compaq pent.4 and a blue screen appeared on my screen with this message: "Bootblock Emergency recovery mode.
    The system flash rom image may be corrupted or the escape key was pressed during power on. If the ESC key was accidentally pressed please reboot the system

    Enter the Administrator password now." Please help as I don't have administrator password and i can't reboot as there is only an on/off button. Looking forward to your assistance. paulgmw@bigpond.com
  • shaik
    dual os winxp and rhel4 how to installation guide me
  • STR
    This didn“t solve my problem.

    My HDD is still dead
  • obernhardt
    I recovered all my data from an inaccessible disk to chkdsk, fixmbr or fixboot with the free testdisk from sourceforge, win version, PC option. Booted from a second hard disk.
  • Appo Apodaca
    Using Windows XP, I used your suggestion but it did not work. I tried the fixboot command and it did take. And I did receive a message that it had been fix, Then I typed in Exit and it rebooted.
    But Now it is just sitting there with the white tracks at the bottom of the screen and has only advanced about twenty bars, so now it is just forzen at those bars.
  • Appo Apodaca
    Did you get my comments.
  • narender
    what type of risk in fixmbr command
  • counsel
    what if you can't remember the administrative password since it is so old.....
  • Ludo
    Use "ERD Wincommander" to set a new admin password. Download the program, burn it as a bootable disc on a CD (.iso) and start your PC with it. After starting, you have an option to change your admin password.
  • dalam
    How to Check the master boot code of hard disk.
  • dude
    superb solution...thx
  • David McGee
    I had to do a low level format of my hard drive to remove partions so that I could copy an image from one identical PC to the other (ie original PC no longer had partitions).

    I have made the new image with Driveimage XML and with Ghost, but the new hard drive still will not boot. All of the files appear to be intact on the copies including system files.

    I have tried both fixmbr and fixboot with no luck. I see format/s or sys dos commands are no longer available under XP.

    What else can I do?
  • Michael N.
    Great... if you have an XP disc. Nobody provides those with PCs anymore.
  • WebMax
    I've used the recovery console lot's of time, it's an excellent in-built tool. If you don't know any commands just type in HELP and a list of them will pop up.
  • what should i do if i don't even have any bootable window xp cd ? is there any recommended tools which can fix it [ mbr,boot file ] properly ?
    thanks in advance
  • andrew
    THanks.
    Your method applies to the assumption that installation is on Drive C:

    What if the failed drive is another drive, or second or third hard drive attached to the computer through USB hub. Will there be an option to select the damaged drive?
  • rafkid
    thanks - worked a treat- quick and simple
  • shobhit_goel10
    can fixmbr make one lose ALL data on a hard drive??
  • stephenjeck
    What if it doesn't recognize the CD ROM drive as a boot drive even though thte BIOs is set to read it first????
  • rg3fb
    Hi. i have a secondary sata hard disk, which don't have xp on it, with huge of important files on it but it doesn't appear on my computer. when i look in device manager i found it an dit says that the device is working properly. when i go to "volumes' and i click on populate, the device 'type' has been change from "basic" to "dynamic" and its "status" has also been change from "online" to "foreign". its "capacity" , "unallocated space" and " reserved space" are 0mb. could someone help me to resolve this problem.
  • Luis
    Thank you, thank you, thank you.

    Your instructions worked like a charm. Flawlessly.

    I installed Ubuntu 9.04 on a flash drive because I didn't want it to mess up my hard drives and it never occurred to me that it would change the MBR anyway. Live and learn.
blog comments powered by Disqus