Home / Setting / How to recover disk boot sector. Recovery of boot sectors of NTFS partitions

How to recover disk boot sector. Recovery of boot sectors of NTFS partitions

No matter how advanced an operating system is, it cannot be booted without having two sectors on the hard drive that contain the code needed to run any operating system. The first sector is called the Master Boot Record (MBR); it is always located at: sector 1/cylinder 0/head1 and is the very first sector hard drive. The second most important sector is the Boot Sector (boot sector), located in the first sector of each volume.

Master Boot Record

The Master Boot Record is the most important disk structure; this sector is created when the disk is partitioned. The MBR sector contains a small code called the Master Boot Code, as well as a disk signature and a partition table. At the end of the MBR sector is a two-byte structure indicating the end of the sector. It has a value of 0x55AA. The disk signature is a unique number located at offset 0x01B8 that allows the operating system to uniquely identify the disk.

The code located in the MBR sector performs the following actions:

  • looks for an active partition in the partition table;
  • looks for the starting sector of the active partition;
  • loads a copy of the boot sector from the active partition into memory;
  • transfers control to the executable code from the boot sector.

If these functions fail to complete for some reason, one of the following system error messages is issued:

  • invalid partition table;
  • Missing operating system.

Note that for floppy disks there is no concept of MBR. The boot sector is the first sector on the disk. It should also be remembered that each HDD contains an MBR sector, but the boot code is used only on disks that have an active primary partition.

Partition table

The partition table is a 64-byte structure used to determine the type and location of partitions on a hard drive. The content of this structure is unified and does not depend on the operating system. The information about each partition is 16 bytes, so there can be no more than four partitions on a disk.

Information about each partition starts at a specific offset from the start of the sector, as shown in Table 1. one .

Note that only volumes with a System ID field of 0x01, 0x04, 0x05, or 0x06 are available under MS-DOS. However, volumes with a different System ID in this field can be deleted using the FDISK utility.

Cylinder, Head and Sector fields

The fields Starting Cylinder, Ending Cylinder, Starting Head, Ending Head, Starting Sector, and Ending Sector (commonly called CHS) are additional elements partition tables. The boot code uses the values ​​of these fields to find the boot sector and activate it. The Starting CHS fields of inactive partitions indicate the boot sectors of the primary partitions and the extended boot sector of the first logical drive in the extended partition.

Need good advice how to produce Windows 7 bootloader recovery if start recovery with installation disk seven did not help. I’ll briefly explain what’s the matter: Windows 7 was first installed on the computer, then Windows XP was needed as the second system, after installation it naturally started alone, I used the EasyBCD program to load two operating systems. In the future, XP became unnecessary and I formatted the partition on which it was located from Windows 7. Now, when loading, there is nothing but a black screen. What can be done in this case? More details if possible. Sergey.

Windows 7 bootloader recovery

Hello friends! Most importantly, do not worry, your problem is simple and, in principle, a simple tool "Restore Windows startup 7" described in our article should help, but! If this article does not help you, then two others should help:

these articles describe some 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 in no case boot after installation on Windows computer XP, since the latter overwrites the Master Boot Record (MBR) with itself during installation. Therefore, you installed an additional boot manager, which is used to configure the boot of several operating systems and has its own bootloader in turn.

  1. I also want to say that often errors are to blame for unsuccessful loading of Windows 7 file system, you can fix them even when the operating system does not boot, all the details in our other article " "
  2. Friends, in this article we will work with the environment Windows recovery 7, or more precisely with the command line of the recovery environment. I will give you the necessary commands, but if it is difficult for you to remember them, you can. This will greatly facilitate your work.
  • The Master Boot Record (MBR) is the first sector on the hard disk, which contains the partition table and a small bootloader program that reads data in this table from which partition of the hard disk to boot the OS, 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 observe a black screen. The problem is being fixed Windows 7 bootloader recovery.

When you uninstalled old XP along with EasyBCD, you left your computer to fend for itself with a boot record that it did not understand, and it gives you a black screen as a token of gratitude. To remedy the situation, we will boot recovery zchika Windows 7namely, we will overwrite the master boot record using the utility Bootrec.exelocated on the recovery disk or on the installation Windows disk 7 (friends, if you have a netbook and want to use the recovery environment that is on the flash drive, then read the comments first). Also, with this utility, we will write a new boot sector, understandable by Windows 7.

Windows 7 Boot Repair Automatically

We boot from the recovery disk or the 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 an analysis of problems that prevent them from loading

Usually problems are found quickly 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 boot will be restored.

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

Choose a tool firstLaunch Recovery, it can also solve problems with loading Windows 7

Restoring the Windows 7 bootloader manually

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

We enter the commands:

diskpart

lis vol (we display a list of hard disk partitions and see that "Volume 1" is a hidden partition System Reserved (Reserved by the system), the volume is 100 MB, it should contain files Windows boot 7 and it is he who needs to be made active). We also see a section with installed Windows 7, 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: is the partition where Windows 7 is installed), this command restores the Windows 7 boot files (the bootmgr file and the boot storage (BCD) configuration files)!

"Download files created successfully"

Restoring the Windows 7 bootloader manually (method number 2)

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

comes full information about the capabilities of the utility. Select the MBR entry Bootrec.exe /FixMbr .

Operation completed successfully. A new boot record has been written to the first sector of the boot partition.
The second command Bootrec.exe /FixBoot writes a new boot sector.

Operation 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 one more tool.

Method number 3

We enter the command Bootrec /ScanOs, it will scan all your hard drives and partitions for operating systems, and if any are found, a corresponding warning will appear. Then you need to enter the command Bootrec.exe /RebuildBcd, this utility will offer to add the found Windows to the boot menu, agree and enter Y and press Enter, all the Windows found are added to the boot menu.

In my case, two Operating Systems. Everything is visible 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 will also be updated.

exit

So, the mistake is that on both of us hard drives the first hidden partitions System Reserved 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 partitions have the following attributes: System. Active and it is on these partitions that the boot storage configuration (BCD) files and the system boot manager file (the bootmgr file) reside. And we get these attributes are other sections. Because of this, Windows 7 and Windows 8 won't boot.

Select the first hard Disk 1, click on the first partition System Reserved (Reserved by the system) with the right mouse and select "Mark as active"

The "System Reserved" volume will be marked as active. We press OK.

We do the same with Disk 2. Acronis Disk Director runs in pending operation mode, so that the changes take effect, click the "Apply pending operations" button

Proceed.

As you can see, after our changes, those sections that you need have become active.

Exit the program and reboot. The result of the work is positive - both operating systems are loaded in turn.

MBR (in Russian - master boot record) - a specific set of data, lines of code, partition table and signatures. Required to boot operating system Windows systems after turning on the computer. There are cases when, as a result of various hardware and system failures, the MBR is damaged or erased, which makes it impossible to start Windows. Restoring the Windows 7 MBR boot record solves such problems. This article discusses several simple ways in which you can restore the records.

A bit of theory

After turning on computer BIOS selects the media to be loaded from. At this stage, the device needs to know exactly which partition of the hard drive contains the Windows system files. MBR is a small program that is stored in the first sector of the HDD and points the computer to the correct partition to start the system.

If you install the second operating system incorrectly, the partition table may become corrupted and the first Windows will not start. The same thing sometimes happens with a sudden power outage. If this happens - do not despair, damaged data can be completely restored.

Boot Record Recovery

In order to restore the MBR, you will need the installation disk from which you installed Windows (or any other). If there is no disk, you can create a bootable USB flash drive with Win7. Action algorithm:

Automatic recovery

To begin with, it is worth providing the MBR repair with standard tools from Microsoft. Select Startup Repair. Nothing else needs to be done, it will take some time, and the computer will report the completion of the process. Try starting Windows. If nothing happened, then you need to restore the ICBM manually.

Command line

This path requires entering several commands in command line Windows.

  • From the System Restore menu, select Command Prompt.
  • Now you need to enter "bottrec / fixmbr". This command is used to write a new MBR compatible with Win 7. The command will remove non-standard parts of the code, fix damage, but will not affect the existing partition table.
  • Then type "bootrec/fixboot". This command is used to create a new boot sector for Windows.
  • Further "bootrec / nt60 sys". This command will update the MBR boot code.
  • Close the console, restart your computer and try to start the system. If the problem is still not resolved, you need to enter a few more commands.
  • Launch the console again and type "bootrec/scanos" and "bootrec/rebuildbcd". With the help of these utilities, the computer will scan the hard drive for operating systems, and then enter them into the boot menu.
  • Next, enter "bootrec / nt60 sys" again and restart the computer.

TestDisk Utility

If you don't have a bootable flash drive or disk, you can repair a corrupted recording using a third-party program. To do this, you need to start another (working) OS. If your machine had only one Windows, you will have to connect the hard drive to another computer. Working with TestDisk is quite complicated, so it is recommended that you read the manuals dedicated specifically to this program.

Or another disk storage device. (For a floppy disk, this is the first physical sector; for a hard disk, it is the first physical sector for each partition) When the computer boots from a floppy disk, it is loaded into memory by the POST program (in IBM PC architecture computers, usually from address 0000: 7c00), control is transferred to it with the long command jump.

The boot sector, sometimes called stage1, i.e. the first stage of operating system boot, loads the program of the second stage of stage2 boot of the operating system ( secondary bootloader, sometimes a boot manager or an authorization and access protection program is loaded as stage2). (In some operating systems, the role of stage1 is performed by the MBR and when booting the OS from the hard disk, the boot sector is not used. On non-bootable partitions of the hard disk, boot sectors may also not contain the boot program)

see also

Links

  • - an example of creating a boot sector

Wikimedia Foundation. 2010 .

See what "Boot sector" is in other dictionaries:

    Wiktionary has the article "sector"

    Sector: Sector (Mortal Kombat. A sector in geometry is a part of a circle bounded by an arc and two radii connecting the ends of the arc to the center of the circle. Sector is a structural unit, department and some public or industrial organizations ... ... Wikipedia

    This term has other meanings, see Sector. A disk sector is the smallest addressable unit of information storage on disk storage devices (HDD, floppy disk, CD). It is part of a disc track. For most devices ... ... Wikipedia

    - (eng. Boot viruses) a computer virus that is recorded in the first sector of a floppy or hard disk and is executed when the computer boots. When you turn on or restart your Boot computer, the virus replaces the boot code, and so ... ... Wikipedia

    A computer virus that writes itself to the first sector of a floppy or hard disk and executes when the computer boots. In English: Boot sector virus See also: Computer viruses Financial Dictionary Finam ... Financial vocabulary

    - (English master boot record, MBR) code and data necessary for the subsequent boot of the operating system and located in the first physical sectors (most often in the very first) on a hard disk or other information storage device ... Wikipedia

    This article should be wikified. Please format it according to the rules for formatting articles ... Wikipedia

    Windows XP starts in the Internet phone machine In computer science, booting is a complex and multi-step process of starting a computer. The boot sequence is a sequence of actions that the computer must perform in order to ... Wikipedia

    Here is a chronological list of appearances of some notable computer viruses and worms, as well as events that had a serious impact on their development. Contents 1 2012 2 2011 3 2010 4 2009 ... Wikipedia

In the case when the device fails to start and errors constantly occur during the download, you should try to use standard tool recovery. If it did not help or is not available, then you can try to fix the boot entries using the command line. How to do this will be described in this article. This method can help when it does not come to starting the OS itself.

bootrec.exe utility

First of all, the standard system recovery utility will be used, which will have to be called from the console.

Unfortunately, in order to start the console, additional steps are required. Will be necessary create a recovery disk or a disk with a version for installing Windows. It's a good idea to have them always on hand, rather than rush to write them down on another device or with friends.

For the seven, you will need to select the item " System Restore”, and then launch the console. For the G8, the first item will remain unchanged, but then you have to go to diagnostics, from there call Extra options and only then start the console.

In the window that appears, enter the command bootrec.exe, after which a list of available actions with all the necessary explanations will appear. Each point will be discussed in more detail below.

Write a new boot sector

The second command in this list will allow you to overwrite the current boot sector under the operating system that is currently available. Sector failures can occur for several reasons:


To fix all this, just enter the fixboot command as shown in the picture.

Fixing the MBR

This command, which is the first line, will allow you to correct the corresponding entries on the system hard drive. In fact, they responsible for order booting the system, from which the BIOS learns what to load and in what sequence. This operation can help if error occurrence:

You need to enter the fixmbr command as shown in the picture, and all these problems should disappear.

How to find all installed systems

There may be situations in which not all installed systems are available for boot. Performing the appropriate operation will allow check device for the presence of other installed operating systems, and using the next section of the article, they can be added to this list. The required command is shown in the picture.

Rebuilding BCD

Entering the corresponding operation /RebuildBcd after the initial command, it will write all found operating systems and recovery tools to the Windows boot configuration file, which will allow them to be displayed at the next boot.

From the article it is clear that many problems with starting the system can be solved independently, using the command line and just one utility. So it's worth trying this option before you start to panic, rearrange the OS, or take your computer in for repair.