Repairing Damaged MBRs and Boot Sectors in x86-based Computers


When you start a computer from the hard disk, the BIOS identifies the startup disk and reads the master boot record (MBR). The master boot code in the MBR searches for the active partition on the hard disk. If the first hard disk on the system does not contain an active partition, or if the master boot code cannot locate the boot sector of the system volume so that it can start the operating system, the MBR displays messages similar to the following:

Invalid partition table.
Error loading operating system.
Missing operating system.

If the active partition exists and the master boot record locates the boot sector of the system volume, the master boot code loads the boot sector of the active partition and transfers CPU execution to that memory address. On computers that are running Windows XP Professional, the executable boot code in the boot sector finds Ntldr, loads it into memory, and transfers execution to that file. However, if the boot sector cannot find Ntldr, which is the file that loads the operating system files from the boot volume, Windows XP Professional cannot start. Windows XP Professional might be unable to find Ntldr in these circumstances:

  • If Ntldr is moved, renamed, or deleted.

  • If Ntldr is corrupted.

  • If the boot sector is corrupted.

  • If you install Windows XP Professional and then later install any of the following on the same computer: MS DOS, Windows 95, Windows 98, or Windows NT 4.0. For more information about configuring a multiple-boot system, see Planning Deployments in this book.

Under the preceding circumstances, the computer might not respond to input or might display one of the following messages:

A disk read error occurred.
NTLDR is missing.
NTLDR is compressed.

Restoring the MBR

You must repair the MBR if it becomes corrupted and you can no longer access any volumes on that disk. You can use several tools to repair the MBR. Which tool you choose depends on whether the partition table is also damaged and whether you can start Windows XP Professional.

  • Use the Recovery Console. You can use the fixmbr command in Recovery Console to repair the MBR. You can start Recovery Console by booting from the Windows XP Professional operating system CD; so this troubleshooting method is available even if Windows XP Professional does not start in normal or safe mode. However, you cannot use Recovery Console to repair partition tables that were damaged by viruses or other corruption.

  • Use DiskProbe. You can use DiskProbe to restore both the MBR and the partition table, but you must have previously backed up this information by using DiskProbe, and you must be able to start Windows XP Professional.

  • Use a third-party disk editor. You can use a third-party MS DOS-based, low-level disk editor to repair the partition table if Windows XP Professional does not start. This method is for experienced users only and involves manually editing the partition table.

Using the Recovery Console to Replace the MBR

You can use the fixmbr command in Recovery Console to rewrite the MBR to resolve a corrupted MBR on a startup disk. However, running fixmbr overwrites only the master boot code, leaving the existing partition table intact. If the corruption in the MBR affects the partition table, running fixmbr might not resolve the problem.

Caution 

Use this command with care because it can damage your partition table if any of the following apply:

  • A virus is present and a third-party operating system is installed on the same computer.

  • A nonstandard MBR is installed by a third-party disk utility.

  • A hardware problem exists.

It is recommended that you run antivirus software before you use the fixmbr command.

To start the computer and use the Recovery Console to replace the MBR

  1. Insert the Windows XP Professional Setup CD ROM into the CD ROM drive.

  2. Restart the computer. If prompted to press a key to start the computer from the CD ROM, press the appropriate key.

  3. When the text-based part of Setup begins, follow the prompts. Press the R key to repair a Windows XP Professional installation.

  4. If you are repairing a system that has more than one operating system installed, from the Recovery Console choose the Windows XP Professional installation that you need to repair.

    Note 

    If you press ENTER without typing a number, the Recovery Console quits and restarts the computer.

    The Recovery Console might also show valid installations of Windows NT 4.0. However, the results of attempting to access a Windows NT 4.0 installation can be unpredictable.

  5. When prompted, type the Administrator password. If you do not have the correct password, or if the security database for the installation of Windows XP Professional you are attempting to access is corrupted, Recovery Console does not allow access to the local disks and you cannot repair the MBR.

  6. To replace the MBR, at the Recovery Console command prompt, type:

    fixmbr 
  7. Verify if you want to proceed. Depending upon the location and the cause of the corruption within the damaged MBR, this operation can cause the data on the hard disk to become inaccessible. Press the Y key to proceed, or press the N key to cancel.

Using DiskProbe to Replace the MBR and Partition Table

If you have backed up the MBR by using DiskProbe, you can use it to restore the MBR on any disk that is not used to start the computer. Restoring the backup MBR rewrites the entire sector, including the partition table. However, DiskProbe only runs under Windows XP Professional, Windows 2000 and Windows NT 4.0. It does not run under MS DOS, Windows 95, Windows 98, or Windows Me.

If the disk that starts Windows XP Professional has a corrupted MBR, Windows XP Professional does not start. Therefore, you cannot use DiskProbe and must use the Recovery Console to replace the MBR.

For more information about restoring backed up MBRs by using DiskProbe, click Tools in Help and Support Center, and then click Windows Support Tools.

Using a Third-Party Disk Editor to Replace the Partition Table

Before you can repair the partition table, you must know the exact values to use to recreate the partition table. If you backed up your MBR and partition table by using DiskProbe, and you have the backup available on a floppy disk or on another computer, you can use DiskProbe on a different computer to see the correct values so that you can manually recreate the partition table.

Replacing the Boot Sector

If Ntldr is damaged or missing, or if the boot sector is corrupted, you can resolve either problem by using the Recovery Console.

To start the computer and use the Recovery Console to replace the boot sector

  1. Insert the Windows XP Professional Setup CD ROM into the CD ROM drive.

  2. Restart the computer. If prompted to press a key to start the computer from the CD ROM, press the appropriate key.

  3. When the text-based part of Setup begins, follow the prompts. Press the R key to repair a Windows XP Professional installation.

  4. If you are repairing a system that has more than one operating system installed, from the Recovery Console choose the Windows XP Professional installation that you need to repair.

    Note 

    If you press ENTER without typing a number, the Recovery Console quits and restarts the computer.

    The Recovery Console might also show valid installations of Windows NT 4.0. However, the results of attempting to access a Windows NT 4.0 installation can be unpredictable.

  5. When prompted, type the Administrator password. If you do not have the correct password, or if the security database for the installation of Windows XP Professional that you are attempting to access is corrupted, Recovery Console does not allow access to the local disks and you cannot replace the boot sector.

  6. To replace the boot sector, at the Recovery Console command prompt, type:

    fixboot [drive:]

If you do not specify a drive letter, the Recovery Console replaces the boot sector of the system volume. If you need to replace the boot sector of a volume that is not the system volume, then you must specify the appropriate drive letter.

Using a Disk Editor to Replace the Boot Sector

If the boot sector is not from the boot volume on the hard disk, you can use several methods to replace it. If you backed up the boot sector by using DiskProbe, then restoring it by using DiskProbe is the fastest method.

If you want to replace the boot sector on an NTFS volume, you have another alternative. When you create or reformat an existing volume as an NTFS volume, NTFS writes a duplicate of the boot sector in the following location:

You can use DiskProbe to locate and copy a duplicate boot sector to the beginning of the volume. There are also third-party MS DOS-based disk tools that you can use to locate and copy this backup boot sector to the primary boot sector on the volume.

For specifically replacing corrupted boot sectors from boot volumes, DiskProbe is not always an option. Unless you created a Windows XP Professional startup floppy disk, you cannot start Windows XP Professional, which is required by DiskProbe. You can use a third-party MS DOS-based, low-level disk editor to restore the backup boot sector.

For more information about creating a startup floppy disk, see article Q119467, How to Create a Bootable Disk for an NTFS or FAT Partition. To find this article, see the Microsoft Knowledge Base link on the Web Resources page at http://www.microsoft.com/windows/reskits/webresources




Microsoft Windows XP Professional Resource Kit 2003
Microsoft Windows XP Professional Resource Kit 2003
ISBN: N/A
EAN: N/A
Year: 2005
Pages: 338
BUY ON AMAZON

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net