28.02.2021

What is no boot sector. Boot sector recovery


No matter how advanced an operating system is, it cannot be loaded without two sectors on the hard disk that contain the code required 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 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. The disk signature is a unique number located at offset 0x01B8 and allows operating system uniquely identify the 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. 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 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.

What to do when the disk partition is on the server or workstation becomes unavailable?

Symptoms

When a disk partition on a server or workstation becomes unavailable or the Disk Administrator defines it as "unknown", the cause may be a bad or damaged boot sector. This article will help you recover the boot sector using a second copy that NTFS keeps.

Keep in mind that two conditions must be met to apply the tips described in this article:

1. The file system of the damaged NTFS disk partition. FAT does not currently save a copy of the boot sector.

2. The ability to boot the computer to Windows NT or 2000 or XP.

Note: If you cannot boot under one of the specified operating systems, connect the hard drive to another computer on which this is possible.

Solution

To solve the problem, you need to get a backup copy of the boot sector and copy it to a specific part of the hard drive.

In NT 3.5x, the second copy is stored in the center of the logical drive.

In NT 4.0 and Windows 2000, it has been moved to the end of the logical drive, which requires a different recovery technique. The described example will use special utility Disk Probe (dskprobe.exe) for NT, which comes with the NT V4.0 Resource Kit. It can also be rewritten as part of the Windows XP SP2 Support Toolkit on this page. Disk Probe works under NT V3.5x too.

Note: to be able to recover in case of an error during the following procedures, while viewing boot sectors that will change, just in case, save their copies to files (the Save as command from the File menu).

Recovering the boot sector of the primary disk partition

1. In Disk Probe, select Drives, Physical Drive, select PhysicalDriveX, where X is the drive number. Use the Disk Administrator utility to determine the disk number. For example, if there are three SCSI disks installed in the system, with SCSI ID numbers 1,3 and 5, Disk Administrator will show their numbers 0, 1, 2. After disconnecting the SCSI ID 3 disk, the next one will take its place (5). In Disk Administrator numbering it will become 1.

2. Double click on the PhysicalDriveX you want to restore. In the field next to it, uncheck the Read Only option and click the Set Active button. You will notice that Active Handle is installed in PhysicalDriveX, click OK.

3. From the Sectors menu, select Read and specify 0 for Starting Sectors and 1 for Number of Sectors. Click Read. After that, you will find yourself about the master boot record physical disk(MBR). You can verify this by looking at the ASCII text on the right side of the window, starting at offset 8B, which should display "Invalid Partition Table". From the View menu, select Partition Table. In the area called "partition table index", use the scroll bar to select the partition under the question and double-click it. The Relative Sector is shown at the bottom left, write down this value and select the Go tab behind this area.

4. Now select Bytes from the View menu. Depending on how damaged the boot sector is, you may even see some lines of text at the top right of the window, or see an "A disk Read error ocurred ..." error message starting at offset 130. From the View menu, select "NTFS bootsector ".

5. Select "Volume End" for NT V4.0 or "Volume Middle" for NT V3.5x. You should now be on an archived copy of the boot sector. If you see the message "incomplete Data Read" or, after viewing, determine that this is not a copy of the boot sector, this may mean that your main sector was damaged, therefore we received an incorrect value for the address of the archive copy. In this case, skip to the next section of our article to find out how to repair the boot sector if it is missing or badly damaged. If everything is ok, go to the next item.

6. From the View menu, select Bytes and check that this is an NTFS boot sector. When we are convinced of this, in the Sectors menu, select Write. Make sure the dialog box displays the correct Handle and PhysicalDrive values. In the Starting Cecjtor to write Data field, enter the Relative sector you wrote down in step 4. Click the Write button.

7. In the Sectors menu, specify the Relative sector, leaving the Number of sectors to 1, select Read. Now make sure the data was written successfully.

8.

Recovering a copy of the boot sector if the original copy is missing or badly damaged

If there is no boot sector or it is damaged so much that it does not have correct information about the number of sectors, recovery can be carried out according to the following plan:

1. In Disk Probe, select Drives, Physical Drive. Select PhysicalDriveX, where X is the disk number, which can be found in Disk Administrator.

2 ... Double-click to open the required PhysicalDriveX, uncheck Read Only in the field below and select Set Active. You should notice that the Active Handle value will be set to PhysicalDriveX. Click OK.

3.

4. You are now in the boot record (MBR) of the physical disk. This can be seen from the text that is displayed from position 8B, which should look something like this: "Invalid Partition Table ...". From the View menu, select Partition Table. It remains to select the required section number, marked with a question mark.

5. Next we need two values: Total Sectors (total number of sectors) and Relative Sectors (relative sector number). Make a note of the Relative Sectors value, this is where the boot sector should be located. To find a copy of it, you will need to do some simple calculations.

6. Selecting Sectors. In the Starting sector field, enter the value defined in the previous step. In the Number of sectors field, enter 1. Press Read and we should get to the archive copy of the boot sector.

7. From the View menu, select Bytes and check if this is an NTFS sector. After checking, go to the Sectors menu, select Write, and check the Handle and PhysicalDrive values ​​in the dialog box that appears. In the "Starting Sector to write Data" field, specify the relative sector number that you wrote (Relative Sectors) and click the Write button.

8. In the Sectors menu, specify the relative sector number again, in the Number of sectors field enter 1, select Read. Now you can verify that the data was written correctly.

9. Close Disk Probe and restart your computer.

Recovering boot sectors of an extended disk partition

1 ... In Disk Probe, select Drives, Physical Drive. Select PhysicalDriveX, where X is the disk number, which can be found in Disk Administrator.

2. Double-click to open the required PhysicalDriveX, uncheck Read Only in the field below and select Set Active. You should notice that the Active Handle value will be set to PhysicalDriveX. Click OK.

3. Select Read from the Sectore menu. In the Starting Sector field, set the value to 0, and for the Number of Sectors - 1. Press Read.

4. You are now in the boot record (MBR) of the physical disk. This can be seen from the text that is displayed from position 8B, which should look something like this: "Invalid Partition Table ...". From the View menu, select Partition Table. In this mode, in the Partition Table Index field, select the partition of the extended disk area. Next, Extended should appear in the System ID field. If the desired partition is the fourth logical drive in the extended area, the Next partition button will have to be pressed four times. The System ID must be NTFS.

5. In the Pattition Table Index area, double-click on the required section in the extended disk area. The System ID should display Extended.

Let's move on to the logical volume that needs to be restored. If it is the second in this area of ​​the disk, the Next Partition button must be pressed twice. When navigating between volumes of an extended disk partition, the System ID field will display file system each volume.

When the partition to recover is found, write down the Current Sector number in the Disk Probe header, the relative sector and the total sectors in this volume. We will need this information to calculate the location of the archive copy of the boot sector.

6. Press the Go button to navigate to the boot sector of the damaged volume. Note the number of this sector from the title of the window (Boot Sector).

To check that you are on the correct sector, select Bytes from the View menu. If the sector is badly damaged, you will see an error message on the right side of the window.

To find a copy of the boot sector, we need three recorded values: the current sector, the relative sector number, and the total number of sectors.

7. Let's make the necessary calculations:

8. Select Sectors, Read and enter the calculated value in the Starting sector field. Number of sectors 1. We select Read and you should be in the sector where the archived copy of the boot sector is located.

From the View menu, select Bytes and make sure it is an NTFS boot sector. If not, an error message should appear in the right column of text. In this case, do not continue, start the whole process over again to rule out errors.

9. After you are sure to find a backup copy of the boot sector, overwrite it with the main one. In the Sectors menu, choose Write. In the dialog box that appears, check the Handle and PhysicalDrive values. In the Starting Sector field, enter the sector number where the damaged boot sector is located. Click the "Write it" button to write.

10. From the Sectors menu, select Read. As the starting sector, again specify the sector number to which you wrote the archive copy, the number of sectors again 1. Select Read and make sure that the data has been written.

11. Close Disk Probe and restart your computer.

Appendix

The described steps are suitable for:

  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional Edition
  • Microsoft Windows NT Workstation 3.5
  • Microsoft Windows NT Workstation 3.51
  • Microsoft Windows NT Workstation 4.0 Developer Edition
  • Microsoft Windows NT Server 3.5
  • Microsoft Windows NT Server 3.51
  • Microsoft Windows NT Server 4.0 Standard Edition
  • Microsoft Windows XP
  • Microsoft Windows XP SP2

Boot sector

The boot sector is the first sector on any DOS logical drive. For example, on a floppy disk or on disk Zip this is the very first physical sector, as a floppy disk cannot be partitioned and has only one logical disk. On a hard disk, the boot sector (s) are located at the beginning of each non-optional partition, or at the beginning of any area of ​​the disk that is recognized as a DOS logical drive.

These sectors are a bit like the boot sectors of partitions, as they contain tables with special information about the logical disk.

A disk parameter block that contains specific information such as partition size, number of disk sectors used, cluster size, and volume label.

Boot code is a program that starts the process of loading the operating system. For DOS and Windows 9x / Me, this is the Io file. sys.

The boot sector of the floppy disk is loaded by the ROM BIOS, and when the system is booted from the hard disk, the MBR transfers control to the boot sector of the active partition. In both cases, the boot sector of the logical disk gains control. It does some checks and then tries to read the first one from the disk. system file(on DOS / Windows, this is the Io. sys file). The boot sector is not visible because it is outside the file storage area of ​​the logical disk.

The logical disk boot sector is created by the DOS and Windows 9x Format program. A hard disk has boot sectors at the beginning of each logical disk in both the primary and secondary partitions. All boot sectors, along with the data on the logical disk, contain a special record, however, at boot, only the code of the sector that is in the active partition is executed. The rest of the sectors are simply read by the operating system to determine the parameters of the logical drives.

The boot sector of a logical disk consists of a program (executable code) and a data area. This information is required by the operating system to determine the size of the logical disk and the placement of structures such as the FAT. The format of the disk parameter block is very specific. Errors in this block can lead to problems loading DOS or lack of access to the disk.

Table 4 shows the DOS boot sector formats of various versions.

Table 26.4. Boot Record Formats for Different DOS Versions

Root directory

A directory is a database containing information about files written to disk. Each record in it is 32 bytes long, and there should be no delimiters between records. The directory stores almost all information about the file that the operating system has.

¦File name and extension - eight characters of the name and three characters of the extension; the period between file name and extension is implied but not included in this entry.

A file attribute byte that contains a flag that represents the standard file attributes.

The time and date the file was created or modified.

Information about the location of the file, i.e. the location of the remaining clusters is contained in the FAT.

There are two main types of directories: root directory and subdirectory. They differ maximum number stored files. Each logical disk has a root directory in a fixed location immediately after the FAT copies. The sizes of the root directories vary depending on the size of the disk, but each specific root directory has a fixed maximum number of files. The length of the root directory is fixed when the logical disk is created and cannot be changed during operation. The size of the root directory of various drives is shown in Table. 5. Unlike the root directory, a subdirectory can store an arbitrary number of files and expand as needed.

Table 5. Root directory size

All directories have the same structure. The records in this database save important information about files, which is associated with information stored in FAT through one of the record fields - the number of the first cluster on the disk occupied by the file. If all the files on the disk did not exceed the size of one cluster, there would be no need for FAT at all. The FAT contains information about the file that is not in the directory - the numbers of the clusters in which the entire file is located.

To track the location of the entire file on disk, refer to the directory and find out the first cluster number and file length. Then, using the file allocation table, scan the chain of clusters occupied by the file until you reach the end of the file.

The format of the 32-byte entry in the directory is shown in Table. 6.

Table 6. Catalog format

Bias

A word corresponds to two bytes in reverse order, a double word to two words in reverse order.

File names and extensions are written with an anchor to the left and padded to the maximum length with spaces, i.e. the file name AL will actually be stored as AL, where periods represent spaces.

Table 7 lists the file attributes used in directory entries.

Table 7 File attributes

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

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

see also

Links

  • - an example of creating a boot sector

Wikimedia Foundation. 2010.

See what the "Boot Sector" is in other dictionaries:

    The Wiktionary has an article "sector" Sector: A sector in geometry is a part of a circle, limited by two for the sake of ... Wikipedia

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

    This term has other meanings, see Sector. A disk sector is the minimum addressable unit of information storage on disk storage devices (HDD, floppy disk, CD). Part of a disc track. Most devices have ... ... Wikipedia

    - (English Boot viruses) a computer virus that writes itself to the first sector of a floppy or hard disk and is executed when the computer boots. When you turn on or restart the computer, Boot 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 Finam Financial Dictionary ... Financial vocabulary

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

    This article should be wikified. Please, arrange it according to the rules of article formatting ... Wikipedia

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

    Here is a chronological list of the appearance of some of the known 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

The new Windows 10 operating system from Microsoft has already gained popularity among millions of PC users around the world. But like all new products, Windows 10 is not without its flaws. Many users of this OS have bootloader problems... Most often, this problem occurs due to a new operating system update policy.

Now in Windows 10, you cannot turn off updates, as was the case in Windows 7 and XP.

The very same problem with the bootloader manifests itself when the user does not wait for the system update to complete and turns it off with the POWER button.

After the user turns on the computer again, he meets such a message on the screen of his monitor.

This message indicates that your bootloader is damaged and should be restored. It is also worth noting that shutting down the computer during the update is not the only reason for the breakdown. The bootloader can still be damaged viruses and various malware... Still quite common reasons for its breakdown are defective HDD, in which are broken sectors, that is, the boot record will be located on these sectors. Also, the cause of the bootloader breakdown may be installing a junior OS over Windows 10... To help our readers restore the bootloader, below we have prepared examples in which we will describe in detail how to restore it.

The easiest way to recover

Seeing a message about a malfunctioning bootloader, the first thing a PC user has to ask is how to restore the Windows 10 bootloader. In this example, we will describe the easiest way to restore it. For this example, we'll need.

If you do not have this disk and Internet access, you can create it on another computer with the same OS.

Also for this task, you can use the original installation disc with Windows 10. Well, let's get started. Insert the recovery disc into the drive and boot from it when the computer starts.

In the first window of the recovery drive wizard, you must specify keyboard layout, after which the wizard menu will open.

In this window, we will select the second tab " Troubleshooting"And immediately go to the next" ".

V additional parameters we are interested in the "" tab. After clicking on this link, the wizard will ask you to select an OS to restore it to start.

One operating room is installed on the studied computer. Windows system 10, so there is only one choice in the wizard. After selecting the OS, the system will begin the procedure for finding computer malfunctions and must restore the damaged bootloader.

If using this method you cannot restore Windows 10 to work, then in the following examples we will describe detailed process repairing the boot sector using system utilities DiskPart and BCDboot.

Repair Windows 10 bootloader using command line

For this method, we also need disk Windows recovery 10 ... Let's boot from the disk, as in the previous example to the point "". In this menu, we are interested in the "" tab, on which we will go.

First of all, we will run the console utility on the command line. DiskPart... To do this, in the console, enter the command diskpart

We need this utility to displaying information about all local disks in the system... Now we need to find the bootloader partition number. This is usually a hidden partition with a size of 500 MB. This partition is created automatically by the Windows 10 installer. Next, to search for it in DiskPart, we will enter the list volume command

From the image you can see that the partition with the boot record is in the first volume on drive C. Also in the image you can see that Windows 10 itself is installed on drive D. Now we must exit disk program... This can be done with the exit command

After exiting DiskPart, enter the bcdboot.exe command D: \ Windows Also note that the command uses drive D, since it is on it that a dozen is installed.

This command completely restored dozens of boot files. The principle of this command is to use the utility BCDboot... The developers specially created this utility to work with boot Windows files ... It is also worth noting that thanks to the same utility, the Windows installer creates a hidden partition and copies boot files to it.

Repairing the Windows 10 bootloader using the command line (Method two)

In the second method, we will also use the utilities DiskPart and BCDboot and try to overwrite the bootloader. To do this, launch DiskPart and find out which disk contains our hidden partition and the partition on which Windows 10 is installed. Launching this utility is described above.

Now we need to format the hidden partition that is in the first volume. To do this, we will type the select volume 1 command which will select our hidden encrypted 500 MB partition.

The next step will be to format the selected section. This is done in order to erase all files from it. For this operation, enter the command in the console format fs = FAT32

After formatting our partition, exit the disk utility and enter the new command bcdboot.exe D: \ Windows which we entered in the previous example.

This command will not fix the bootloader files as in the previous example, but will create new... As you already understood, this method is used if the first did not work.

Another way to restore Windows 10 boot using command line

This method requires a utility Bootrec... Unlike the previous utility, this utility does not restore bootloader files, but restores boot record... That is, she repairs MBR- the first sector on the HDD. It is very important for the operating system that the MBR is safe and sound. When a computer starts up, its BIOS first of all looks for the MBR to launch the operating system from it. For this example, run, as in the previous examples, command line... The utility in question has two main commands / FixMbr and / FixBoot The first command is required to fix MBR and the second creates a new... First of all, consider the situation when our MBR is damaged. To do this, enter the first command in the console.

In the image above, you can see that the operation was successful, which means that the MBR has been recovered.

Now let's consider the situation when the first method does not work, that is, we will create a new MBR sector. To do this, we will use the second command.

From the image above, you can see that the new MBR sector was created successfully.

The examples show how easy it is to recover the MBR sector using the Bootrec console utility. If you have problem with the start m Windows 10, we advise you to use this example first.

We clean the system from malicious software before restoring the bootloader

If the cause of the bootloader breakdown is malware then this the malicious code must be removed before recovery... In this situation, it will help you. This is the rescue disk that has many tools for restoring your computer, as well as treating it from viruses... You can download Dr.Web LiveDisk on its official website www.drweb.ru. This Live CD is linux based and free. This disc is distributed as ISO image, which can be written to both an optical disc and a USB flash drive. After the image is written to the disk, launch Dr.Web LiveDisk.

In the start menu, select the first item and continue loading Dr.Web LiveDisk. After a few seconds, the Linux-based OS should start, which is actually Dr.Web LiveDisk.

In this operating system, you can completely clean your computer from viruses and even make a backup of all information.

Also useful is the fact that this OS has full Internet support and a built-in browser. Firefox.

Summing up

In conclusion, I would like to say that if you know all the intricacies of bootloader recovery, then you can quickly fix your computer. It is also worth paying attention to the situation when it is impossible to restore the boot sector and the bootloader itself. In this case, you need to play it safe and use the full system recovery tools. Such means are complete system image, created by means of the Windows 10 operating system itself, as well as a program such as Acronis True Image... We hope that our material will help you recover the bootloader from MBR, and your computer will function as before.

Related Videos


2021
maccase.ru - Android. Brands. Iron. news