Restoring the MBR for Windows 7

During my explorations of dual-booting of Windows 7 and Ubuntu 10.10, I ended up restoring the master boot record (MBR) so that Windows 7 could load again or to find out if it wouldn’t start for me. The first hint that came to me when I went searching was the bootsect command but this only updates the master boot code on the partition so it did nothing for me. What got things going again was the bootrec command.

To use either of these, I needed to boot from a Windows 7 installation DVD. With my Toshiba Equium laptop, I needed to hold down the F12 key until I was presented with a menu that allowed me to choose from what drive I wanted to boot the machine, the DVD drive in this case. Then, the disk started and gave me a screen where I selected my location and moved to the next one where I selected the Repair option. After that, I got a screen where my Windows 7 installation was located. Once that was selected, I moved on to another screen from I started a command line session. Then, I could issue the commands that I needed.

bootsect /nt60 C:

This would repair the boot sector on the C: drive in a way that is compatible with BOOTMGR. This wasn’t enough for me but was something worth trying anyway in case there was some corruption.

bootrec /fixmbr
bootrec /fixboot

The first of these restores the MBR and the second sorts out the boot sector on the system drive (where the Windows directory resides on your system. In the event, I ran both of these and Windows restarted again, proving that it had come through disk partition changes without a glitch, though CHKDISK did run in the process but that’s understandable. There’s another option for those wanting to get back a boot menu and here it is:

bootrec /rebuildbcd

Though I didn’t need to do so, I ran that too but later used EasyBCD to remove the boot menu from the start-up process because it was surplus to my requirements. That’s a graphical tool that has gained something of a reputation since Microsoft dispensed with the boot.ini file that came with Windows XP for later versions of the operating system.

Repairing Windows XP

I have been having an accident-prone time of it with Windows XP recently and have had plenty of reason to be thankful for the ability to perform a repair installation. Here are the steps:

  1. Pop the installation disk into your PC’s DVD drive and reboot the PC.
  2. If you have your PC set it up to boot from DVD’s in its BIOS, then you at least will have to option to do this. You may find that this happens by default but I needed to tell it to do the deed.
  3. Select normal installation from the first menu that is presented to you by the installer.
  4. Accept the licence agreement.
  5. Press R at the next menu and that’ll repair the installation.
  6. Follow all of the menus from there on; it’ll be all the usual stuff from here on in and there should be no need to reactivate Windows or reinstall all of your other software afterwards.

There is a repair option on the first screen (step 3 above) but this takes you into the dark recesses of the command line and isn’t what I was needing. I do have to say that they do leave the required option late on in the installation process and that assumes on users having a risk taking streak in them, something that definitely does not apply to everyone. If your boot.ini file is not well, you may find yourself needing to do the full installation and that wipes the slate clean on you, extending the recovery process.