Windows 7 utilities for the bootloader. Preventing MBR boot record from being overwritten

For many years, Microsoft has been improving the recovery system for the Windows operating system, and in Windows 7 and Windows Vista it works almost automatically. If you boot from the Windows 7 installation disc and click " System Restore" ("Repair Computer"), the Windows recovery system will start and will independently try to fix all the 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.

The Bootrec.exe application is used to fix errors associated with bootloader corruption and, as a result, the inability to start the Windows 7 and Windows Vista operating systems.

Sequence of actions

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. In this case, the existing partition table is not overwritten.

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. A previous version of the Windows operating system was installed 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 installer .

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

The boot sector of the system partition will be overwritten with BOOTMGR compatible code. You can learn more about using the bootsect.exe utility by running it with the parameter /help.

Bootrec.exe /ScanOs

Launched with the /ScanOs switch, 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 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

The example above exports the current boot configuration store to C:\BCDcfg.bak, removes its system, hidden, and read-only attributes, removes it with DEL, and rebuilds it with bootrec /RebuildBcd.


Enlarge picture

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

Recovering 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.

The command line in this case might look like this:

Bcdboot.exe e:\windows

Replace e:\windows with the path that matches your system.
This operation will repair a corrupted Windows boot environment, including boot configuration data (BCD) store files, including the bootmgr file mentioned above.

Syntax of bcdboot command line parameters

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

BCDBOOT source]

source

Specifies the location of the Windows directory used as the source when copying boot environment files.

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

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.

Optional parameter. Enables detailed logging mode of the utility operation.

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.

Resume

The article discussed the principles of working with the bootrec.exe and bcdboot.exe utilities, which are used to resolve problems associated with the inability to start the Windows 7 operating system due to a damaged or missing bootloader.

Despite the huge number of built-in security measures, the abundance of multifunctional antiviruses and firewalls, the Windows bootloader can be damaged. This makes it impossible to start the operating system. If at startup you see a black screen for a long time without any visible changes or the message “bootmgr is missing”, you have become a victim of this particular problem. In this case, restoring the startup of Windows 7 can help.

Bootmgr is a special program called the Windows startup manager. It is to her that the BIOS transfers control after checking the functionality of the components and the hard drive. The manager reads information from the first sector of the disk and finds all the necessary data to start the OS, after which the process of starting the system itself begins.

Causes of breakdown

The most common cause of damage to the Windows boot loader is computer infection with viruses. In the process of actively surfing the Internet, as well as installing various free software downloaded from dubious sources, the user may inadvertently download a malicious program that will change or delete part of the Bootmgr loader.

A similar result can occur due to power outages while the device is operating or incorrect modification of the boot sector of the hard drive. Therefore, never turn off your computer by unplugging the power cord or using the power supply power button.

Windows Recovery

You can carry out this procedure using an installation disk or bootable USB flash drive. There are many ways to create a flash drive. One of the simplest is using special utilities like UNetBootIn or UltraISO. Burn the Windows 7 image to media, restart your computer and follow the instructions:

After this procedure, try restarting your computer and check the result. If the system still won't boot, try going to the options menu again and selecting System Restore. This process is more complicated and will take longer, but it can help solve the problem.

Hello dear readers.

Sometimes, as a result of various actions, it may happen that the computer refuses to enter the operating system. And in some cases, this is due to a malfunction of an important tool. The solution is to restore the Windows 7 bootloader.

There are several main signs indicating the need to “return to life” the corresponding element of the operating system:

Bootrec( )

To return your computer to working condition, you need to perform a number of steps. In addition, for the procedure we will need Windows installation files. So we can’t cope with the corresponding data without a disk. We do the following:


This command will show all the possible parameters it works with.

Description of Bootrec keys( )

Teams in the environment cmd.exe can be launched in the standard version, or with special additions. So, for example, if you write “ bootrec.exe /FixMbr", the program writes a boot record to the main partition. Moreover, the latter is compatible with Windows 7 and Vista. This will help restore the functionality of the device. In addition, you can resort to this trick if there is a need to remove non-standard code in the corresponding segment. However, the existing partition table remains the same.

If you use the key " /FixBoot", the program writes a new boot sector. It is also compatible with the above operating systems from Microsoft. This option is used in several cases:

    The boot file has been replaced with a non-standard one.

    It's damaged.

    After the seventh version or Vista, the previous build was posted. For example, after installing XP, the Windows NT boot loader is used.

Interesting to know! The same effect can be achieved by using the program " bootsect.exe" It is also on disk. To do this, we write “ bootsect /NT60 SYS" A boot sector that is compatible with "" will appear. For detailed information, you need to run the utility with the key " /help».

When writing " bootrec.exe /ScanOs", the application scans all available disks for OS 7 and Vista. As a result, users receive a list of all systems found, even those not registered in the boot data storage.

Using the key " /RebuildBcd" will start scanning all disks for installed operating systems. A list is compiled from which they can be added to the storage. In addition, this command will allow you to rebuild the database. However, before doing this, you definitely need to delete past data.

The above utility has wide functionality. But it will not help if the system startup file is missing. In this case, you need to resort to another tool.

It is worth noting that it works automatically. That is, users only need to get to certain tools, enter a command, and everything will be done independently - there is no need to do anything during the process itself.

BCDboot( )

This tool is designed to create or repair a bootloader located on the main partition. The program also allows you to transfer files between hard drives. Even if the system is not visible on the latter.

To get started, just type “ bcdboot.exe C:\windows" The operation recovers damaged data, including storage files.

The process has several parameters:

    Source – the location of the directory in which the Windows distribution is located. In our case, this is a plastic disk or USB flash drive. This parameter is required. The rest are indicated as necessary.

    « /I» — sets the environment language. If left unchanged, English is used.

    « /s"—indicates the drive letter where the required files will be placed. By default, this is the location that is set by the BIOS or the new system - UEFI.

    « /v"—the detailed work accounting mode starts.

    « /m» - combining the parameters of an existing record and a newly created one. All this is written to a new boot area.

Returning after using Linux( )

It’s worth imagining a situation where you previously had an operating system from Microsoft. And after installing Linux, the first one suddenly stopped starting. This happened as a result of some errors.

If Windows doesn't work for you after installing Ubuntu, don't panic right away. The problem can be solved simply.

dd if=/dev/sda2 of=/linux.boot bs=512 count=1

The code above allows you to copy the boot sector from the " sda2" in linux.boot.

It is worth noting that in this operating system the root element “ / " If this is not the case in your personal situation, first you need to find out which of the existing areas is bootable.

The entry was copied to the user's folder. Therefore, we go to the appropriate directory and transfer the file to the partition where Windows is already installed.

The result will be " Command line", in which we write only two lines and after each click " Enter»:
Bootrec.exe /FixMbr
Bootrec.exe /FixBoot
After that, we restart the device and see how everything works in our OS.

Need good advice on how to produce Windows 7 Boot Loader Recovery, if restoring the startup using the 7 installation disk did not help. I’ll briefly explain what’s going on: Windows 7 was first installed on the computer, then the second system needed Windows XP, after installation it naturally started alone, to boot two operating systems I used the EasyBCD program. Later, XP was no longer needed and I formatted the partition on which it was located from Windows 7. Now, when loading, there is nothing except a black screen. What can be done in this case? More details if possible. Sergey.

Restoring the Windows 7 bootloader

Hello friends! The most important thing is not to worry, your problem is not complicated and, in principle, the simple “Windows 7 Startup Recovery” tool described in our article should help, but! If this article does not help you, then two others should help:

These articles describe several more good ways to restore the boot of your operating system, besides them there is one more, so try it and don’t just give up.

Let me remind you that you cannot install an older operating system after a younger one; Windows 7 will under no circumstances boot after installing Windows XP on a computer, since the latter overwrites the master boot record (MBR) during installation. Therefore, you installed an additional boot manager, which is used to configure the boot of several operating systems and, in turn, has its own bootloader.

  1. I also want to say that file system errors are often to blame for unsuccessful loading of Windows 7; they can be corrected even if the operating system does not boot; all the details are in our other article." "
  2. Friends, in this article we will work with the Windows 7 recovery environment, or more precisely, with the recovery environment command line. I will give you the necessary commands, but if it is difficult for you to remember them, you can. This will make your work much easier.
  • The master boot record (MBR) is the first sector on the hard drive, which contains a partition table and a small bootloader program that reads from this table the data from which partition of the hard drive to boot the OS, and then the information is transferred to the partition with the installed operating system, to download it. If the master boot record contains incorrect information about the location of the system, then we will receive various errors during boot, here is one of them “BOOTMGR is missing press CTR-Alt-Del for restart” or we will see a black screen. The problem is being fixed restoring the Windows 7 bootloader.

When you uninstalled old XP along with EasyBCD, you left your computer to the mercy of fate with an incomprehensible boot record, and it gives you a black screen as a sign of gratitude. To rectify the situation, we will carry out boot recovery Windows 7, namely, we will overwrite the master boot record using the Bootrec.exe utility located on the recovery disk or on the Windows 7 installation disk (friends, if you have a netbook and you want to use the recovery environment located on a flash drive, then read the comments first). We will also use this utility to record a new boot sector, understandable to Windows 7.

Recovering Windows 7 bootloader automatically

We boot from a recovery disk or installation disk with Windows 7, in the initial phase of booting the computer, when prompted to boot from the disk “Press any key to boot from CD...”, press any key on the keyboard for 5 seconds, otherwise you will not boot from the disk

There is a short search for installed Windows systems and analysis of problems that prevent them from loading

Usually problems are quickly found and the recovery environment offers to fix them automatically. Click on the "Fix and restart" button, after which the computer will restart and Windows 7 will be booted again.

If problems with loading the system continue or you are not prompted to fix the problems automatically, then in this window you need to select the operating system that you need to restore, you most likely have one and Next.

First of all, choose a productStartup recovery, it can also solve Windows 7 boot problems

Restoring the Windows 7 bootloader manually

If this remedy does not help, choose a remedy Command line

Enter the commands:

diskpart

lis vol (we display a list of hard drive partitions and see that “Volume 1” is a hidden System Reserved partition, volume 100 MB, Windows 7 boot files should be located on it and this is what needs to be made active). We also see a partition with Windows 7 installed, it has the letter D:, the volume is 60 GB.

sel vol 1 (select Volume 1)

activ (make it active)

exit (exit diskpart)

bcdboot D:\Windows (where D: the partition with Windows 7 installed), this command restores the Windows 7 boot files (bootmgr file and boot storage configuration files (BCD))!

"Download files created successfully"

Restoring the Windows 7 bootloader manually (method No. 2)

In the command line window, enter the command Bootrec and Enter

full information about the capabilities of the utility is displayed. Select the master boot record entry Bootrec.exe /FixMbr.

The operation was completed successfully. A new boot record is written to the first sector of the boot partition.
The second command, Bootrec.exe /FixBoot, writes a new boot sector.

The operation was completed successfully. Exit. Next, we try to load our Windows 7.


Friends, if the Bootrec.exe /FixMbr and Bootrec.exe /Fixboot commands do not help you, do not despair, there is another remedy.

Method No. 3

Enter the command Bootrec/ScanOs, it will scan all your hard drives and partitions for the presence of operating systems and if any are found, an appropriate warning will be issued. Then you need to enter the command Bootrec.exe /RebuildBcd, this utility will offer to add the found Windows to the boot menu, we agree and enter Y and press Enter, all the found Windows are added to the boot menu.

In my case, two operating systems were found. Everything can be seen on the screenshot.

In addition to the above method, there is another one, enter bootsect /NT60 SYS on the command line, the main boot code, it will also be updated.

Exit

So, the error is that on both hard drives the first hidden System Reserved partitions should be marked with a red flag. On Windows 7, the volume of such a partition is 100 MB, and on Windows 8, 350 MB, these sections have the attributes: System. Active and it is on these partitions that the boot store configuration files (BCD) and the system boot manager file (bootmgr file) are located. And it turns out that these attributes are carried by other sections. Because of this, Windows 7 and Windows 8 will not boot.

Select the first hard disk 1, right-click on the first System Reserved partition and select "Mark as active"

The System Reserved volume will be marked as active. Click OK.

We do the same with Disk 2. Acronis Disk Director works in pending operation mode; for the changes to take effect, click the “Apply pending operations” button

Continue.

As you can see, after our changes, those sections that were needed became active.

We exit the program and reboot. The result of the work is positive - both operating systems are loaded one by one.