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

MBR, which is also defined as or home 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.

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 operating system is installed on the conditional PC Windows systems and Linux. 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 loading drivers with its own, which may well ruin the original MBR entry.

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/ on the path along which it will remain old version boot sector.

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.

OS boot problems are a widespread phenomenon among Windows users. This happens due to damage to the means responsible for starting the system - the MBR master boot record or a special sector that contains files necessary for a normal start.

As mentioned above, there are two reasons for boot problems. Next, we’ll talk about them in more detail and try to solve these problems. We will do this using the recovery console, which is contained on the Windows XP installation disk. For further work we need to boot from this media.

If you only have a distribution image, you will first need to burn it to a flash drive.

MBR recovery

The MBR is usually written in the very first cell (sector) on the hard drive and contains a small piece program code, which is executed first during boot and determines the coordinates of the boot sector. If the record is damaged, Windows will not be able to start.

  1. After booting from the flash drive, we will see a screen with options available for selection. Click R.

  2. Next, the console will prompt you to log in to one of the copies of the OS. If you did not install the second system, it will be the only one on the list. Enter the number here 1 from the keyboard and press ENTER, then the administrator password, if there is one, if it is not set, then just click "Enter".

    If you have forgotten your administrator password, please read the following articles on our website:

  3. The command that “repairs” the master boot record is written like this:

  4. The new MBR has been successfully written, you can now exit the console using the command

    and try to start Windows.

    If the launch attempt was unsuccessful, then we move on.

Boot sector

The boot sector in Windows XP contains the boot loader NTLDR, which “fires” after the MBR and transfers control directly to the operating system files. If this sector contains errors, then further start of the system is impossible.


Recovering the boot.ini file

In file boot.ini the order of loading the operating system and the address of the folder with its documents are specified. In case if this file If the code is corrupted or the syntax is broken, then Windows will not know that it needs to start.


Transferring boot files

Except boot.ini files are responsible for loading the operating system NTLDR And NTDETECT.COM. Their absence makes booting Windows impossible. True, these documents are on the installation disk, from where you can simply copy them to the root system disk.

  1. Launch the console, select the OS, enter the admin password.
  2. Next you need to enter the command

    This is necessary to view a list of media connected to the computer.

  3. Then we need to select the drive letter from which we are in this moment loaded. If this is a flash drive, then its identifier will be (in our case) "\Device\Harddisk1\Partition1". You can distinguish a drive from a regular hard drive by its capacity. If we use a CD, then select "\Device\CdRom0". Please note that the numbers and names may differ slightly, the main thing is to understand the principle of choice.

    So, we have decided on the choice of disk, enter its letter with a colon and click "Enter".

  4. Now we need to go to the folder "i386" Why are we writing?

  5. After the transition you need to copy the file NTLDR from this folder to the root of the system disk. Enter the following command:

    and then agree to a replacement if offered ( "Y").

  6. After successful copying, a corresponding message will appear.

  7. Next we do the same with the file NTDETECT.COM.

  8. The final step is to add our Windows to a new file boot.ini. To do this we run the command

    Enter the number 1 , enter the identifier and boot parameters, exit the console, boot the system.

All actions we take to restore the download should lead to the required result. If you still fail to start Windows XP, then most likely you will have to reinstall. You can “rearrange” Windows while preserving user files and OS settings.

Conclusion

A download “breakdown” does not happen on its own; there is always a reason for it. These can be either viruses or your actions. Never install programs obtained from sites other than official ones, do not delete or edit files that were not created by you, they may turn out to be system files. Implementation of these simple rules will help you avoid having to resort to a complex recovery procedure once again.

Microsoft has been improving the recovery system for the Windows operating system for many years, and in Windows 7 and Windows Vista it works almost perfectly. automatic mode. If you boot from the installation Windows disk 7 and click "" ("Repair Computer"), the Windows repair system will start and automatically try to fix any errors that it finds. She 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 keys for launching 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 bootable media Windows 7. To do this you need to run bootsect.exe with the following parameters:

bootsect /NT60 SYS- The boot sector of the system partition will be overwritten with code compatible with BOOTMGR. 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 used, it displays a list of found systems that are not currently registered in the configuration data store Windows boot(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 file Windows boot loader bootmgr is corrupted 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

In every operating room Windows system personal computer There are special tools that are responsible for an action or operation. But there is a tool with which you can change errors and problems, and also implement windows recovery from the command line.
If loading the OS fails, you need to use the Bootrec.exe utility.

With its help, computer problems are resolved, data is corrected, including Windows loading or configuration files downloads

Bootrec.exe - help with fixing Windows boot

If you have problems starting your computer and find problems with it, you should use the method for fixing Windows boot errors. It doesn’t matter which Windows is installed, the problem must be solved so that you can continue to perform the tasks assigned to you.

When working with a tool like Butrek.exe, they use commands for, but if a problematic situation arose in the OS itself, the tool must be launched inside it.

If this happened in Windows 7 version, you will need installation media or a disk that is capable of boot recovery hard sector disk. You can boot from USB or DVD discs, it depends on the OS version.

Fig.1. When you see such a picture on the monitor, click on the highlighted function

Then you need to decide on the choice of operating system that needs to be updated. This is a serious task, since among many systems there is only one that requires fixing. To continue, click the “Next” button.

Fig.2. A new window will open with recovery properties, but only the boot command line is needed here

If you do not have a disk for installation on Windows 7 or a disk responsible for restoring the boot sector, you will need access to tools. They, with the help of restorative hidden sections. Windows 7 will be able to set them automatically when the OS is installed.

Follow a specific sequence: you need access to Recovery Systems, Diagnostics, Advanced Options and Command Line

Writing new boot sectors

The bootrec function with the /FixBoot parameter will make it possible to write to the boot sector inside the system partition on hard drives. When performing this procedure, you need to use boot partitions, but only those that are compatible with Windows OS versions 7 and 8.

The following parameters can be used:

  • If there is damage on the boot sectors, and their structure and size do not meet the requirements of the hard drive.
  • When recording boot sectors that are not compatible with the Windows system.
  • When the old Windows OS was installed in place of the new version.
In order to write a new boot sector, you need to run bootrec.exe as in the picture

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 the built-in methods for partitioning your hard drive from Windows.

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...”. This 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.
Computer