Windows 7 boot failure repair (BCD and MBR)

  

After the computer is powered up, the BIOS program is first started. After the BIOS self-test is completed, the main boot record MBR on the hard disk is found, and the MBR reads the DPT (partition table). Find the active primary partition, and then read the active primary partition PBR (partition boot record, also called dbr, what is the name, the network is still arguing, let's call it pbr), PBR then search for the boot in the partition The manager file BOOTMGR, after the BOOTMGR was found, the control was handed over to BOOTMGR. BOOTMGR reads the bootbcd file (BCD=Boot Configuration Data, which is “startup configuration data”, in short, the bcd file under windwows7 is equivalent to the boot.ini file under xp), if there are multiple operating systems And if the waiting time of the operating system is not 0, then the operating system selection interface will be displayed on the display. After we choose to start WINDOWS7, BOOTMGR will go to the boot disk to find WINDOWSsystem32winload.exe, and then load the windows7 kernel through winload.exe, thus starting the whole windows7 system.

This process can be summarized as follows: BIOS-->MBR-->DPT-->pbr--> Bootmgr-->bcd-->Winload.exe-- > Kernel loading --> whole windows7 system

This article talks about MBR-->DPT-->pbr--> Bootmgr-->bcd this possible failure Solution.

There is a problem with mbr, mainly because the mbr code is rewritten, because the code being rewritten is different, so the error information is different. For example, we installed windows7 and ubuntu dual system, ubuntu rewritten mbr, after we format the partition where ubuntu is located, we can neither enter windows7 nor enter ubuntu. When booting, there will be an error message like this:

The solution is to rewrite mbr. For rewriting mbr, we are familiar with rewriting with the fdisk /mbr command under dos. The mbr rewritten by fdisk /mbr is compatible with xp, but it is not so compatible with windows7. Practice shows that after rewriting the mbr of windows7 with the fdisk /mbr command, you need to rebuild bcd, otherwise you can't start windows7 normally. Some netizens pointed out that the reason for this is that the fdisk /mbr command rewrites the hard disk signature in mbr. The general partitioning tools can be rewritten by mbr, such as diskgenius, which is rewritten with mbr compatible with windows7. It can also be rewritten with the bootrec /fixmbr command. To run the Bootrec.exe tool, you must start Windows RE. To do this, follow these steps:

Insert the windows 7 installation CD and boot the computer from the CD. After the CD is booted, press shift f10 to bring up the cmd command prompt. At the cmd command prompt, type: bootrec /fixmbr Enter. This also rewrites mbr.

There is a problem with the partition table. For this problem, it is limited to the length and will not be discussed in detail.

The system disk is not the active primary partition. In this case, you can use the partitioning tool (such as diskgenius) to set the system disk as the active primary partition.

There is a problem with pbr, mainly because the pbr code is rewritten because the code being rewritten is different, so the error message is different. For example, the active partition of the WINDOWS7 system is written to the pbr suitable for XP. The simple solution is to use the bootrec /fixboot command to rewrite the pbr:

Insert the windows7 installation CD, boot from the CD, boot on the CD When done, press shift f10 to bring up the cmd command prompt. At the command prompt, type: bootrec /fixboot Enter. This also recreates the pbr of the active partition.

There is also a common command to mention here, this is bootsect:

Insert the windows7 installation CD, boot from the CD, after the CD is booted, press shift f10 Bring up the cmd command prompt. At the cmd command prompt, type: bootsect /nt60 sys /mbr

Enter. This command will overwrite the pbr of the active partition and will also rewrite mbr so that mbr and pbr are suitable for windows7 and vista.

The bootsect.exe program is located in the boot directory of the windows7 installation CD. You can extract this file. You can run this program on the command line under xp, or you can run this program on the command line under winpe. This program is very convenient when used. The use of the bootrec.exe command is not so convenient. So the BOOTSECT command is applied more widely.

There is another point to point out, the boot folder inside the vista installation CD also exists this gadget, but the vista bootsect command does not have the /mbr parameter, so it can only rewrite the pbr, but can not rewrite the mbr This is something that must be noted. Practice shows that clearing the mbr of a hard disk and then running the bootsect command of windows7 can indeed find that mbr is restored. This also shows that the windows7 bootsect command can indeed rewrite mbr.

In addition, the bootsect command can also rewrite xp's mbr and pbr, which is not possible with the bootrec command. The xp recovery console uses the fixmbr command to overwrite the mbr and the fixboot command to overwrite the pbr.

If it is a boot file problem, you can usually rewrite the boot file with the bcdboot command:

Insert the windows7 installation CD, boot from the CD, after the CD boot is complete, press shift f10 , call up the cmd command prompt. At the command prompt, type:

bcdboot x:windows /sx:

Note that this previous x: is the disk where the windows7 windows folder is located, usually c: if you Not the c drive, please change to the corresponding drive letter. This latter x: is the drive letter of the active primary partition, usually also the c drive. So the general way of writing this command is: bcdboot c:windows /s c:

But you need to be aware that the drive letter you see in the windows re environment is not necessarily the same as the drive letter you see under windows7. So you need to first use the dir /a command to confirm that each disk is correct.

For example:

cd /dc:

dir /a

The purpose of these two commands is to first enter the root directory of the c: drive. Then display all the files and folders in the root directory of the c drive. According to the displayed files or folders, you can determine which disk you see under Windows 7.

The boot files of windows7 are mainly files in the bootmgr and boot folders, and the files in the boot folder are mainly bcd files. The bcdboot command will rewrite all windows7 boot files in the specified partition.

If there is a problem with the bcd file, you can use the bootrec command to rebuild bcd:

Insert the windows7 installation CD and boot from the CD. After the CD is booted, press shift f10 to bring up Cmd command prompt. At the command prompt, type:

bootrec /RebuildBcd

If you find the operating system of windows7 or vista that is not written to bcd, you will be prompted to write or not. It will also be written.

Or use the bcdedit command to manually rewrite bcd, but the operation is much more complicated.

Copyright © Windows knowledge All Rights Reserved