Menu
Is free
registration
home  /  Programs/ Rebuild mbr boot sector. Hard disk boot sector recovery

Repair mbr boot sector. Hard disk boot sector recovery

Boot from the emergency system floppy disk and run the SYS C: command, which will create a Boot Sector on the system disk and copy the system files there. Make sure that the operating system versions on the floppy disk and on the disk being restored are the same.

Recovery of Boot Sector is easier to perform in an "automatic" way, but this does not exclude the possibility of "manual" recovery using pencil, paper and the disk editor. As mentioned above, if the restored disk contains intact (or at least partially damaged) elements of the logical structure, save them as files on the spare disk.

Not an easy case. Not only Boot Sector destroyed

However, there is a copy of the required system areas in the form of files or disk areas.

Perform a standard formatting of the main disk partition, i.e. with the format C: command. In this case, the file structure of the formatted disk partition is formed with the recreation of the Boot Sector, clean FAT and Root Directory, the data area is not affected, i.e. the information in the Data Area does not change.

Check if the location of the root directory is correct. To do this, DiskEditor, in the cluster view mode of the newly created partition, by searching for the "Subdirectory" object, check the coincidence of the physical cluster numbers and the cluster number in the first record of the found subdirectories. If the numbers do not match, it is necessary to correct the value of the number of FAT sectors in the Boot Sector boot record. The adjustment is carried out by increasing the sectors by a multiple of half the number of sectors in the cluster. As a rule, such adjustment is necessary in cases of non-standard disk partitioning or after artificial resizing of partitions.

If you are lucky and you have the surviving FAT and / or Root Directory images backed up as files, you should use DiskEditor to restore them to the disk. If you have a second copy of FAT, but the first one does not, you should copy the second copy and replace the first copy.

If you have survived one of the FAT copies and the root directory, after completing all the points above, full access to information on the disk will be restored.

How to restore Boot Sector manually

The Boot Sector address can be found in the physical sector with coordinates 0/0/1 (Track / Head / Sector) in the corresponding section of the Partition Table element. Next, you need to go to this sector and view it in the Boot Record format (the F7 key in Disk program Editor). If there is "garbage" in the fields of the root sector, then this sector must be manually restored. You need to fill in the rest of the boot sector with zeros or copy the boot sector of the system floppy to this place if the disk partition is active (C :) Then you need to manually fill in the control fields of this sector:

Boot Record field

Correct value

You can write your name here

Bytes per sector

Sectors per cluster

We calculate later

Reserved sectors at beginning

Root directory entries

Total sectors on disk

This value is taken from the Partition Table (field + 0Ch in the corresponding element)

Media descriptor byte

Sectors per FAT

We calculate later

Sectors per track

The value is taken from Drive info

Special hidden sectors

This value is equal to the Relative Sectors value (field + 08h in the corresponding Partition Table element) If the disk is not bootable, then the number 8388608 (800000h) is added to this value

In this table, the Sectors per FAT and Sectors per Claster fields are left blank. They need to be calculated additionally:

Sectors per FAT: We look at the sectors of the disk following the Boot Record until we find the beginning of the root directory. We remember the coordinates of the directory sector. Then we calculate the relative number of this sector relative to the Boot Record based on the fact that the Number of Sides on the disk, the Number of Sectors per Track and the Relative address of the Boot Record = 1 are known. Then we find the required S / F field:

S / F: = (<Относ. сектор каталога>-1) div 2.

Sectors per Claster: This value should be chosen on the basis that it can take on the values ​​8 sect / clast or 4 sect / clast.

Note. The description above is for FAT 16. If your disk uses FAT 32, refer to it. the description

In every operating room Windows system personal computer there are special tools that are responsible for an action or operation. But there is such a tool with which you can change errors and problems, as well as implement windows recovery from the command line.
If the OS does not load, you must use the Bootrec.exe utility.

With its help, problems in the computer are eliminated, data is corrected, including, windows boot or config files downloads.

Bootrec.exe - help fixing Windows boot

If you have problems starting your computer and find problems with it, you should use the error correction method Windows boot... 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 such as Butrek.exe, they use commands for, but if a problem situation occurs in the OS itself, the tool must be launched inside it.

If this happened in Windows 7 version, you will need an installation media or disk that is capable of recovering the boot sector hard 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 the operating system that needs updating. This is a big challenge, as there is only one fix required among many systems. Click the Next button to continue.

fig. 2. A new window will open with recovery properties, but here you only need the boot command line

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 are using restorative hidden sections... Windows 7 will be able to ask them in automatic mode when the OS is installed.

Follow a specific sequence: you need access to Recovery Systems, Diagnostics, Additional parameters 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 disks. When performing this procedure, you need to use boot partitions, but only those that are compatible with Windows 7 and 8 versions.

These parameters can be applied:

  • If there is damage on the boot sectors, and their structure and size do not correspond to the requirements of the hard disk.
  • When writing incompatible boot sectors with the Windows system.
  • When the old Windows OS was installed in place of the new version.
In order to record a new boot sector, you need to run bootrec.exe as in the picture

No matter how advanced operating system, it cannot be loaded without the presence of two sectors on the hard disk, which contain the code necessary to start any operating system. The first sector is called the Master Boot Record (MBR); it is always located at the address: sector 1 / cylinder 0 / head1 and is the very first sector of the hard disk. The second most important sector is the 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 the disk signature and partition table. At the end of the MBR sector, there is a two-byte structure pointing to the end of the sector. It has the value 0x55AA. A disk signature is a unique number located at offset 0x01B8 that allows the operating system to uniquely identify a given disk.

The code in the MBR sector does the following:

  • looks for the 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 cannot be completed for some reason, one of the following system error messages is generated:

  • 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

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

Information about each section starts at a certain offset from the beginning of the sector, as shown in table. 1 .

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 of this field can be deleted using the FDISK utility.

Cylinder, Head and Sector fields

The Starting Cylinder, Ending Cylinder, Starting Head, Ending Head, Starting Sector, and Ending Sector fields (collectively called CHS) are additional elements of the partition table. 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 advanced section.

Sometimes it happens that due to curvature, or viruses on the computer, boot sectors and, of course, the OS can fly off WinXP not loads, giving a system message that the bootloader is corrupted Windows, or the registry is damaged Windows, or damaged system files, or even worse, nothing is loaded except for the virus information written by the virus into your boot sector. With all this, it is impossible to get to the restore point, nor load the last successful config, nor boot into safe mode... In most cases, users immediately try to reinstall Windows, although, as a rule, you can restore its performance in 5-10 minutes using the so-called recovery console.

First you need to have boot disk/ USB flash drive with installation package Windows XP Pro.
1. Then go into the BIOS (when you turn on the computer, press at intervals of half a second F2 or Del or F10- depending on the manufacturer of the motherboard)
2. V BIOS set primary boot from CD-ROMs / Flash drives, put the disk into the sdrom or, respectively, a USB flash drive. Reboot.
3. When the installer Windows XP will upload its files to RAM PC, the dialog box "Install Windows XP Professional"Containing a selection menu from which we are interested in the item

To restore Windows XP using the recovery console, press R

Click on R... The Recovery Console will load. If the computer has one operating system installed, and it is (by default) installed on the C: drive, then the following message will appear:

1: C: \ WINDOWS
In which copy of Windows should you sign in?

Enter 1, press Enter
A message will appear:

Enter admin password:

Enter your password, click Enter(if the password is empty - just press Enter).

The system prompt will appear:

Enter fixboot

A message will appear:

End section: C :.
Do you want to write a new boot sector to the C: partition?

Enter y(which means 'yes').

A message will appear:

File system in the boot partition: NTFS(or FAT32).
Command FIXBOOT writes a new boot sector.
The new boot sector was written successfully.

The system prompt that appears C: \ WINDOWS>
enter fixmbr

A message will appear:

**A WARNING**
This computer has a non-standard or invalid primary boot record... Using FIXMBR can damage the existing partition table. This will lead to the loss of access to all partitions of the current hard disk.
If there are no disk access problems, it is recommended to terminate the command FIXMBR.
Confirm the entry with a new one MBR?

Enter y(which means 'yes').

A message will appear:

A new MBR is made to the physical disk \ Device \ Harddisk0 \ Partition0.
The new master boot record has been successfully completed.

At the system prompt C: \ WINDOWS>
enter, enter BIOS Setup and put the initial boot from the hard drive or simply remove all bootable CD drives from the computer.

In 95% of cases, this way it is possible to restore working capacity. Windows XP.

NOTES:
1. If you do not know what Registry Windows and Recovery Console, in such critical situations - to avoid worsening the situation! - do not try to fix everything yourself - it is better to seek help from specialists.

2. If more than one OS is installed on your PC, do not use the recommendations of this article - immediately contact the specialists!

3. The recommendations of this article are NOT a panacea! It is POSSIBLE (but whether it is necessary, decide for yourself!) To use them when it is impossible to reach the system restore point, nor to load the last good configuration (the PC does not boot even in safe mode), and you are already going to reinstall the OS.