Repairing the bootloader using the recovery console in Windows XP. Boot sector recovery How to recover Windows boot sector

MBR, which is also defined as or Master Boot Record, is a sector hard drive, containing information about its partitions and serving as the operating system loader.

The Master Boot Record is the first 512 bytes (4096 bits) of your HDD and is created when the first Windows installations. If the MBR becomes corrupted, you will no longer be able to start the operating system and continue to use it as usual. This fact concerns the following Windows versions: XP, Vista, 7 and 8.

Symptoms of MBR Damage:

1. Operating System not found(Operating system not found).

2. Error loading operating system(Error loading operating system).

3. Invalid partition table.

4. FATAL: No bootable medium found.

5. Reboot and Select proper Boot device (Restart the system and select the appropriate boot device.

We have listed only the main errors, messages about which may appear when starting the operating system. In fact, there are a large number of them and it makes no sense to analyze each one, since there are only a few solutions for the immense number of possible failures.

Causes of MBR corruption:

  • Malicious software, viruses.
    After restoring the boot sector, do not forget to check HDD for the presence of possible viruses. Some of them are capable of replacing the MBR code with their own, which will inevitably lead to its corruption.
  • Dual boot available.
    Let's assume that the Windows and Linux operating systems are installed on the conditional PC. In this case, an unintentional error may occur and the MBR may be corrupted.
  • Third party software.
    Failures in the boot sector are not always caused by viruses or errors in the operation of two simultaneously installed operating systems. Sometimes even popular software can cause MBR corruption. For example, Acronis replaces disk boot drivers with its own, which may well corrupt the original MBR record.

So, having figured out what MBR is, having found out possible reasons the occurrence of failures and their symptoms, we are finally ready to begin directly restoring the Master Boot Record.

1. MBR backup.

Before you begin repairing the Master Boot Record, we strongly recommend that you repair it. backup. To do this, use the following command:

dd if=/dev/sda of=/path-to-save/mbr-backup bs=512 count=1

Replace fragment /path-to-save/ to the path where the old version of the boot sector will be saved.

2. Restoring the MBR using the bootrec command.

To proceed further, you will need a bootable device with a pre-installed version of Windows 10.

Brief instructions:

  • System Restore.
  • 3. Go to section.
  • 4. Open the utility Command line.
  • Enter.
    When finished, do not close the command line.

    bootrec /FixMbr
    bootrec /FixBoot
    bootrec /ScanOs
    bootrec /RebuildBcd

  • 7. Enter exit and press Enter.
  • 8. Restart your computer.
  • 1. Start your computer using bootable media.
  • 2. On the welcome screen, click on the option System Restore.
  • 3. Go to the section Troubleshooting.
  • 4. Open the utility Command line.
  • 5. Enter the following commands in it, confirming the execution of each by pressing a key Enter.

    diskpart
    sel disk 0
    list vol

  • Fs FAT32. Chapter EFI FAT32 2 , enter the following command:

    If the volume number is not equal 2

  • 7. Assign to section new r:\

    assign letter-r:

  • 9. Enter exit to leave the utility DiskPart.
  • r:\ EFI:

    cd /d r:\EFI\Microsoft\Boot\

  • bootrec/fixboot

  • ren BCD BCD.backup

  • BCD and replace r:\ previously assigned letter:
  • c:\
  • 16. Enter exit.
  • 17. Restart your computer.

Recovering MBR in Windows 8 and 8.1

To proceed further, you will need a bootable device with a pre-installed version of Windows 8.

Brief instructions:

  • 1. Start your computer using bootable media.
  • 2. On the welcome screen, click on the option System Restore.
  • 3. Go to the section Troubleshooting.
  • 4. Open the utility Command line.
  • 5. Enter the following commands in it, confirming the execution of each by pressing a key Enter. When finished, do not close the command line.

    bootrec /FixMbr
    bootrec /FixBoot
    bootrec /ScanOs
    bootrec /RebuildBcd

  • 6. Remove the boot device.
  • 7. Enter exit and press Enter.
  • 8. Restart your computer.

If this instruction If you are unable to restore the master boot record, use the following:

  • 1. Start your computer using bootable media.
  • 2. On the welcome screen, click on the option System Restore.
  • 3. Go to the section Troubleshooting.
  • 4. Open the utility Command line.
  • 5. Enter the following commands in it, confirming the execution of each by pressing a key Enter.

    diskpart
    sel disk 0
    list vol

    These commands will allow you to select the first disk of your computer for work and display a list of its logical partitions.

  • 6. Find the volume element with the column Fs FAT32. Chapter EFI must be strictly with the format FAT32. If the volume partition is indicated by a number 2 , enter the following command:

    If the volume number is not equal 2 , replace 2 with any other available digit.

  • 7. Assign to section new letter, a letter that is different from the one already available on your computer. For example r:\. To perform this task, use the following command:

    assign letter-r:

  • 8. Wait for the message below to appear:

    Diskpart successfully assigned the drive letter or amount point.

  • 9. Enter exit to leave the utility DiskPart.
  • 10. The following command will be needed to replace r:\ the letter that was previously assigned to the partition EFI:

    cd /d r:\EFI\Microsoft\Boot\

  • 11. Enter the command below to repair the disk volume:

    bootrec/fixboot

  • 12. Now you need to do backup copy old BCD:

    ren BCD BCD.backup

  • 13. Enter the following command to create a new BCD and replace r:\ previously assigned letter:

    bcdboot c:\Windows /l ru-ru /s r: /f ALL

  • 14. In the above command, we have specified the operating system letter − c:\. If you installed Windows on a drive with a different path, please specify the correct drive letter.
  • 15. Remove the boot device.
  • 16. Enter exit.
  • 17. Restart your computer.

To proceed further, you will need a bootable device with a pre-installed version of Windows 7.

  • 1. Start your computer using bootable media.
  • 2. Specify the operating system language.
  • 3. Select your keyboard layout.
  • 4. Click Further.
  • 5. Select your operating system and click again Further.
  • 6. On the screen System Recovery Options select utility Command line.
  • 7. As soon as command line will start, enter the following command:

    bootrec /rebuildbcd

  • 8. Click Enter.
  • 9. Next enter:

    bootrec /rebuildbcd

  • 10. Click Enter.
  • 11. Remove the bootable media and restart the computer.

If these commands to restore the master boot record are powerless, use the instructions below:

  • 1. Determine the letter of your boot device by sequentially entering the following commands:

    diskpart
    select disk 0
    list volume

  • 2. Now enter:

    exit
    F:
    cd boot
    dir

    Letter F: replace with the letter under which the bootable media is identified.

  • 3. Enter the command:

    bootsect /nt60 SYS /mbr

  • 4. Confirm the operation by pressing Enter.
  • 5. Remove the boot device.
  • 6. Enter the command exit.
  • 7. Now click Enter

For further work you will need a boot device with a pre-installed version Windows Vista.

  • 1. Start your computer using bootable media.
  • 2. Select your language and keyboard layout.
  • 3. On the welcome screen, select an option System Restore.
  • 4. Select your operating system and click Further.
  • 5. Open the utility Command line.
  • 6. Once the application starts, enter the following commands in sequence:

    bootrec /FixMbr
    bootrec /FixBoot
    bootrec /RebuildBcd

  • 7. Wait for each operation to complete.
  • 9. Type exit.

As an alternative to the bootrec command, you can try to restore the MBR automatically:

  • 1. Start your computer using bootable media.
  • 2. On the welcome screen, select the option System Restore.
  • 3. Select an option Startup recovery.
  • 4. Wait until the process completes and restart your computer.

There is another, more complex, alternative to MBR recovery. Its concept revolves around direct BCD repair. After starting Windows using the CD/DVD, open a command prompt and enter the following commands:

bcdedit /export C:\bcdbackup
C:
cd boot
attrib bcd -s -h -r
ren c:\boot\bcd bcd.backup
bootrec /rebuildbcd

Confirm execution of each command by pressing a key Enter.

Recovering MBR in Windows XP

To proceed further, you will need a bootable device with a pre-installed version of Windows XP.

  • 1. For further work, you will need a bootable device with a pre-installed version of Windows Vista.
  • 2. When the welcome screen appears, press the R key to open Recovery Console
  • 3. When asked about further actions, answer the system by entering a number 1 and confirm the operation by pressing the key Enter.
  • 4. If necessary, enter the administrator password.
  • 5. Enter the command fixmbr.
  • 6. When the system asks you to confirm your actions, press the key Y And Enter.
  • 7. Wait for the operation to complete.
  • 8. Remove the boot drive.
  • 9. Enter the command exit.
  • 10. Click Enter to restart your computer.

We hope the article was useful to you and helped you restore the boot sector of your disk.

But there are problems with it too. When a computer running this OS refuses to boot, it may be necessary to restore the HDD boot sector, from which the entire system is initialized and started.

If the problem is not related to user actions, as a rule, the built-in Windows 7 diagnostic tools will be able to solve the problem on their own, just wait until the reboot after an unsuccessful start, in which you will be asked to boot into the system recovery tool and select the self-fix option there.

So, if you encounter the problems described at the beginning of this material, first of all, calm down, nothing bad happened and everything can be fixed, since restoring the boot sector for a modern operating system is a standard procedure.

Your actions will differ depending on what exactly led to the inability to boot into the “seven”.

If you installed the WinXP operating system on top of Win7, then you should download the EasyBCD program. By running it in XP you will be able to simple actions restore the bootloader and return it to the list Windows boot 7.

If, for example, you installed Windows XP on top of Windows 7 and booted via EasyBCD, and then, for some reason, decided to remove the XP partition to the HDD, then you have a more complicated situation. By uninstalling XP, you also uninstalled EasyBCD, which means that now the computer does not know how to load any OS.

To restore boot Windows sector 7 you will have to remember where you have the Win7 recovery disk (of course you created it, right?) or, if the answer is no, then look for the disk. It doesn’t matter what you find, whatever is there, insert it into the drive. Now you need to boot from the disk and enter the “System Restore” section. Using the Bootrec.exe utility, which is available on the installation disk and the 7 recovery disk, restoring the Win7 boot sector will not take much time.

When you select “System Restore”, after a short wait you will have options; most likely, it will be possible to restore only one OS - Windows 7. On the next screen at the bottom, you will see the “Command Prompt” option, click on it and a window will open in which will need to type several commands.

First you should check if everything is ok with the Bootrec utility, to do this, type in bootrec and press the Enter key. Next, each command will need to be completed by pressing this key. A text will appear describing the capabilities of the utility.

To start restoring the boot sector, type the command

If in response the computer writes that “The operation was completed successfully,” then everything is in order and the bootloader has been rewritten. You can move on to the second part, type the command

bootrec/fixboot

After you press enter, the computer will create a new boot sector, you can now type the command

After all these manipulations you can enjoy normal operation your OS.

As you have seen, restoring the Windows 7 boot sector is indeed a very simple procedure.

Many years Microsoft company improved the recovery system of the Windows operating system, and in Windows 7 and Windows Vista it works almost automatically. If you boot from installation disk Windows 7 and click "" ("Repair Computer"), system Windows recovery will be launched and will independently try to correct all errors that it finds. It can fix a large number of problems, however, it is quite likely that the bootloader is damaged, and the recovery system cannot cope with this problem. In this case, you can restore the bootloader manually using the Bootrec.exe utility.

Application Bootrec.exe serves to correct errors associated with bootloader corruption and, as a result, the inability to start the Windows 7 and Windows Vista operating systems.

Sequencing

The utility will display help on the available command line switches.

Description of startup keys for the Bootrec.exe utility

Bootrec.exe /FixMbr- Launched with the /FixMbr switch, the utility writes a Windows 7 and Windows Vista-compatible Master Boot Record (MBR) to the system partition. Use this option to resolve problems with the master boot record being corrupted, or if you wish to remove non-standard code from it. The existing partition table is not overwritten in this case

Bootrec.exe /FixBoot- Launched with the /FixBoot switch, the utility writes a new boot sector compatible with Windows 7 and Windows Vista to the system partition. This option should be used in the following cases:

  1. The Windows Vista or Windows 7 boot sector has been replaced with a non-standard boot sector.
  2. The boot sector is damaged.
  3. Has been installed previous version Windows operating system after installing Windows Vista or Windows 7. For example, if Windows XP was installed, NTLDR (Windows NT Loader, Windows NT loader) will be used, the code of the standard NT 6 loader (Bootmgr) will be overwritten by the Windows XP installation program.

It should be noted that a similar effect can be achieved using the bootsect.exe utility, also located on the Windows 7 bootable media. To do this, you need to run bootsect.exe with the following parameters:

bootsect /NT60 SYS- Boot sector system partition will be overwritten by BOOTMGR compatible code. You can learn more about using the bootsect.exe utility by running it with the /help parameter.

Bootrec.exe /ScanOs- Launched with the key / ScanOs, the utility scans all disks for installed Windows Vista and Windows 7 operating systems. In addition, when using it, a list of found systems is displayed that are this moment are not registered in the Windows boot configuration data store (Boot Configuration Data (BCD) Store)

Bootrec.exe /RebuildBcd- Launched with this key, the utility scans all disks for the presence of installed Windows Vista or Windows 7 operating systems. Found operating systems are displayed in a list from which they can be added to the Windows boot configuration data store (Boot Configuration Data Store). Also use this option if you want to completely rebuild the boot configuration data store. Before doing this, you must delete the previous storage. The set of commands could be as follows:

bcdedit /export C:\BCDcfg.bak
attrib -s -h -r c:\boot\bcd
del c:\boot\bcd
bootrec /RebuildBcd

In the above example, the current boot configuration store is exported to a file C:\BCDcfg.bak, the “system”, “hidden” and “read-only” attributes are removed from it, after which it is deleted with the DEL command and rebuilt with the command bootrec /RebuildBcd.

Of course the utility Bootrec.exe is very functional, however, it will not help if, for example, the Windows bootmgr file is damaged or physically missing. In this case, you can use another utility, also included in the Windows 7 distribution media - bcdboot.exe.

Restoring the boot environment using BCDboot.exe

BCDboot.exe is a tool that is used to create or restore a boot environment located on the active system partition. The utility can also be used to transfer download files from one hard drive or partition to another.

The command line in this case might look like this:

bcdboot.exe e:\windows

Replace e:\windows to the path appropriate for your system. This operation will repair a corrupted Windows boot environment, including the Boot Configuration Data (BCD) store files, including the file mentioned above bootmgr.

Syntax of bcdboot command line parameters

The bcdboot.exe utility uses the following command line parameters:

BCDBOOT source ]

source- Indicates location Windows directory, used as a source when copying boot environment files.

/l- Optional parameter. Sets the boot environment language. The default is English (US).

/s- Optional parameter. Specifies the drive letter of the system partition where the boot environment files will be installed. By default, the system partition specified by the BIOS firmware is used.

/v- Optional parameter. Enables detailed logging mode of the utility operation.

/m- Optional parameter. Combines the parameters of the newly created and existing boot storage record and writes them to the new boot record. If an operating system boot loader GUID is specified, combines the boot loader object with the system template to create a boot entry.

Summary. The article discussed the principles of working with utilities bootrec.exe And bcdboot.exe, which are used to resolve problems related to the inability to start the Windows 7 operating system due to a damaged or missing boot loader

If Windows does not load when you turn on your computer and the process freezes on a black screen, your hard drive's boot record (MBR) may be damaged.

External manifestations

When an error appears on the screen, doubts disappear.

Other information about a malfunction of the HDD bootloader may also be displayed.

The text information may vary depending on the classification of the error. But when the word boot is mentioned, it is clear that there is a problem with loading.

You can find out how to restore the MBR on this page.

Causes

Please note the common causes of HDD boot sector failures.

Two types of bootloader

Older systems prior to Windows XP used the NT Loader (NTLDR). In Windows 7, Vista and subsequent versions of the OS, UEFI and EFI began to be used. Therefore, old and new systems are usually not installed on the same PC. Otherwise, NTLDR overwrites UEFI.

Third party software

Errors in the HDD boot sector can occur when using even popular programs for the hard drive partition. This happened to me with Acronis. This happens because such software replaces disk loading drivers with its own. This can corrupt the original MBR entry. Therefore, it is better to use built-in methods hard section Windows disk.

Viruses

Viruses sometimes wreak havoc on the MBR. Therefore, after restoring the HDD boot, check your computer with anti-virus programs.

If you are sure that the cause is viruses, then clean your PC of them before repairing the MBR. For this purpose, there are utilities from well-known antivirus companies, for example, Kaspersky Rescue Disk. They are provided free of charge on official websites with instructions for use.

Any of these programs is included in the software package for a CD or DVD, which allows you to boot from a CD, find and remove viruses on the HDD.

Windows 7 Boot Recovery

Sector repair is performed from a CD or USB flash drive with the operating system installation package.

  1. First, insert the DVD into the drive or flash drive into the USB connector with the Windows distribution.
  2. Then you need to allow startup from these devices. This is done in the BIOS settings.

Changing download sources

Technology of the following order:


Be sure to press F10 when exiting, otherwise the changes will not be saved!

Working from a CD or flash device

Proceed in the following order:

  1. After the reboot, the following message will appear at the bottom: “Press any key...”. It asks you to press any key. Click. It won't work out otherwise. If the inscription has already disappeared, repeat everything from the beginning. To do this, press three keys at once: Ctrl+Alt+Del. This will cause the computer to restart.
  2. When you boot from the DVD or flash drive, the Windows installation window will appear. At the bottom left, select “System Restore”.
  3. You will be prompted to connect network capabilities, select languages ​​or a drive letter. Don't change anything and get to the choice of systems.
  4. Highlight the desired Windows and check the box next to “Use recovery tools...”.
  5. If the required system does not exist, it should appear when you click “Download drivers”.
  6. Continue with the “Next” button.
  7. In the next window, select “Startup recovery”, and the MBR can be reanimated automatically.
  8. If the sector does not work, then press “Command Line”.
  9. On the command line, call the Bootrec utility and write for it to repair the MBR: bootrec/fixmbr. You end each command with the Enter key.
  10. Then create a new boot sector: bootrec/ fixboot. To exit the program, type exit and remember to press Enter.

If the fixes didn't help

There is another MBR resuscitation team - bootsect /NT60 SYS. After that, try to boot again.

If the attempt fails, write on the command line like this: bootsect/rebuildbcd. A search will be performed for operating systems installed on the PC.

Now try logging into Windows again. Please note that there will now be one more system in the list. Try to enter each of them. It should work!

Non-standard way

If all sector recovery options do not help, it is recommended to reinstall Windows. And no matter how much you want to do it sometimes! Isn't it true?

I thought so too and decided to put another small system nearby. What does "small" mean? This is a bootloader system. It is empty: I did not install drivers or my programs on it, because I don’t work in it. But it's loading!

I achieved what I needed: a working boot area appeared on the hard drive. Now I log into the old system normally. The downside is that I lost about 14 GB of disk space. If you are not afraid, you can use this method!

How to fix a sector in Windows 8-10 and Vista?

For Vista and later versions of Windows, the same methods are suitable as for the “seven”, only the design is different. For example, in the “eight” he is like this.

But the points remain the same. Therefore, we will not describe them. Use the instructions described above for Windows 7.

On Windows XP

In the "experiment" sector, the principle of resuscitation of the sector is similar. But the entrance is a little different. Now you will see it:

  1. After booting from the CD, system files are copied to the hard drive.
  2. Then the action selection window appears.
  3. You select the recovery option using the console, so press the R key.
  4. Next, they will ask you which system to log into. When she is alone, there is nothing to choose, but you need to answer. To do this, press the number “1” on the keyboard if it says: “1. C:\WINDOWS,” or click on another number next to the desired OS.
  5. Then a black DOS screen appears. This is the same command line, but for the entire monitor area. You are dialing fixboot and press Enter.
  6. You will be asked if you want to record a new boot sector.
  7. If you answer positively: write Y. Let me remind you that you press Enter after each entered command or your answer.
  8. Then a record of a successful operation appears if everything went correctly.