win7引导修复(Win7 boot repair)
win7引导修复(Win7 boot repair)
Windows7 boot repair
I. overview of the Windows7 boot
(a) terminology description
Bootmgr (Windows, Boot, Manager):Windows Startup Manager
BCD (Boot, Configuration, Data): start configuration data storage
(two) dual partition Windows7 and single partition Windows7
1, double partition Windows7:Win7 after the installation of default occupied two primary partitions, a C (Windows folder where the disc, the first partition, the hard disk is not active) and a hidden partition (boot file where the hard disk, second partitions, real active partition).
2, Windows7: a single partition can be two Win7 partitions installed by default the merge method is: be made one, the two partition file merge to C (i.e. the first hard disk partition); the C set active partition; the implementation of the "bootsect /nt60 c:" to write the C BOOTMGR compatible boot code; the computer starts with Windows7's installation CD into the CD-ROM, select "repair computer" CD "system recovery options" began to work, and wait that completed, restart OK.
(three) the boot process of Windows7
1, BIOS, according to the set of storage medium order polling to the hard disk, first looking for the hard disk MBR (master boot record) and DPT (partition table), and then in accordance with the MBR and DPT information to find the system partition.
2, there are two important information in the hard disk MBR (boot code): one is the target partition, and the other is the system type". The bootsect with the /MBR parameter writes both the active tag and the system type to the MBR".
3, DPT is like a map, MBR in the "target partition" is the destination names, general partitioning tools will be the name as "active", but some software will carry out special adaptations of the names, such as a wizard will rewrite the names for their "backup / restore partition". This "backup / recovery partition is not active.
4, the active partition PBR (partition boot record, also known as OBR or DBR) also has an important message (boot code), that is, the boot file name". For WinXP, the boot file name is ntldr". For Win7, the boot file name is bootmgr". According to the BIOS MBR and DPT to find the active partition, press PBR "boot file name" for NTLDR in the root directory (BOOTMGR) file, if found will control to NTLDR (BOOTMGR), if they can not find that NTLDR (BOOTMGR) lost end guide. Bootsect with different parameters can write different boot file names to PBR".
After 5 and NTLDR (BOOTMGR) take over control, search and load the startup environment file (font, file, etc.) and start the configuration file in the root directory, and then follow the instructions in the startup configuration file to proceed to
the next boot. For WinXP, the startup configuration file is boot.ini in the active partition root directory, and the boot.ini is single in content. It instructs NTLDR to load the system kernel directly. For Win7, the boot configuration file is the active partition the root directory of the boot\BCD BCD complex, it will make a number of instructions BOOTMGR verification of system configuration, first verify whether there is BOOTMGR compatible with the "system type" information MBR hard disk, and then verify the consistent guidance, prove the inconsistency is prompted, termination guide.
6, Win7 failed to start, will usually have five tips: looking for equipment - active partition PBR blank, the boot process did not loaded into the BOOTMGR format by the active partition; no operating system -- not compatible with BOOTMGR MBR in the "system type" information - FDISK by /MBR 3; boot automatically start the Windows startup repair "- no problem, but the partition table is local disorder recovery caused by the wrong GHOST. The Windows boot manager pops up the 0xc000000f error - everything else is ok,
But the partition table GHOST does not restore local disorder caused by the deletion + /Recovery directory; the Windows boot manager 0xc000000e BOOTMGR popup error can not find the dvice option is specified in the BCD partition -- cause see "four, manual fix 0xc000000e error".
7, about GHOST: GHOST objects include the entire PBR, file systems and user data. GHOST will not change the size of the target partition, but it will cause partial disorder of the partition table.
Two, Windows7 boot code maintenance
(1) overview of Windows7 boot code maintenance
The purpose of the maintenance of the boot code is to update the MBR of the hard disk (master boot record) and the partition's PBR (partition boot record) to switch between identifying BOOTMGR and identifying ntldr. The most convenient, versatile and professional tool for updating MBR and PBR is Bootsect. Bootsect.exe is a single file program (attached to the boot directory of the Windows vista/7 installation CD) that supports the Windows command line running (including the WinPE command line). It is recommended to start WinPE on disk, execute bootsect.exe, execute bootsect.exe under hard disk operating system, and sometimes cause PBR update to fail because of unable to lock target volume. Also note that the Vista's bootsect.exe does not have a /mbr parameter, so it can only update the PBR and not update the MBR.
(two) Bootsect command parameter
Bootsect.exe {/help /nt52 /nt60} {SYS ALL | | | |
}[/force] /mbr
Parameter description
/help display instructions.
/nt52 applies the NTLDR compatible master boot code to SYS, ALL, or . The operating system installed on SYS, ALL,
or must be Windows (R) XP.
/nt60 applies the Bootmgr compatible master boot code to SYS, ALL, or . The operating system installed on SYS, ALL, or must be Windows Vista?.
SYS updates the main boot code on the system partition used to start Windows.
ALL updates the main boot code on all partitions. The ALL option does not have to update the startup code for each volume. Instead, this option updates startup code that can be used as a Windows boot volume (excluding dynamic volumes that do not have a connection to the underlying disk partition). This limitation exists because the boot code must be at the beginning of the disk partition.
updates the main startup code on the volume associated with this drive letter. In the following two cases, the boot code is not updated:
is not associated with the volume
is associated with a volume that is not connected to the underlying disk partition.
/force forcibly dismount the volume during startup code updates. This option must be used with care.
If Bootsect.exe cannot obtain exclusive volume access, the filesystem may overwrite the boot code before the next restart.
Bootsect.exe always attempts to lock and dismount volumes before each update. When a /force is specified, the attempt is forced to dismount if the initial lock attempt fails. For example, if the file on the target volume has now been opened by another program, the lock may fail.
If the lock is successful, forced dismount will enable exclusive volume access and reliable startup code updates, even if the initial lock fails. At the same time, forced dismount will render all open handles to files on the target volume invalid. This can cause unexpected behavior from programs that open these files. Therefore, be careful to use this option.
/mbr updates the master start record without changing the partition table on the disk sector 0 that contains the partitions specified by SYS, ALL, or . When used with the /nt52 option, the master boot record is compatible with the operating system of the previous version of Windows Vista. When used with the /nt60 option,
The master boot record will be compatible with Windows, 7, Windows, Vista, Windows, Server, 2008, or Windows Server 2008 R2.
(three) Bootsect application example
Bootsect /nt52 E: writes the PBR compatible WindowsXP to the E disk.
The bootsect /nt60 sys /mbr writes Windows7 and Vista MBR to the hard disk and writes Windows7 and Vista PBR to the active
partition for the active partition.
The bootsect /nt52 sys /mbr writes the WindowsXP compatible MBR to the hard disk and writes the WindowsXP compatible PBR to the active partition.
(four) Bootsect returns the information definition
The following is the Win7 returned to the dual partition WinPE rewrite PBR and MBR success after the return of information.
Target, volumes, will, be, updated,, with, NTLDR, compatible, bootcode
(the target volume will be updated with the NTLDR compatible boot code)
2, X: \Volume{,}> <\\?
(local computer identifier {-} the volume (partition), X: is the volume of the letter, do not display the X: and < > when not allocated. Special attention should be paid here to the fact that the identifiers identified by Bootsect are mostly wrong
3, Successfully, updated, NTFS, filesystem, bootcode
(successfully updated the NTFS filesystem boot code)
4, Updated, NTFS, filesystem, bootcode. The, update, may, be, unreliable, the, volume, since, could, not, be,, locked, during, the, update
(update the NTFS file system boot code. The update may not be valid because the volume cannot be locked when it is updated
Bootcode, was, successfully, updated, on,, all, targeted, volumes
The boot code on all target volumes has been successfully updated
6? \?? \PhysicalDrive0?
(local computer \ physical drive 0, generally refers to the main hard disk)
7, \Device\Harddisk0\DR0
(device / hard disk 0\ data logger 0)
8, Successfully, updated, disk, bootcode
(successfully updated disk boot code)
Three, Windows7 boot file maintenance
(1) overview of Windows7 boot file maintenance
The Windows7 boot file includes the BOOTMGR and the entire boot directory (containing BCD, etc.), and if one of the files is missing or corrupted, Windows7 will not start. There are three ways to guide document maintenance:
1, full backup method: that is, a copy of the boot file to save, and if necessary, then copy back.
2, Bcdedit editing method can only be used for maintenance: BCD, because BCD does not like XP boot.ini that directly use Notepad to open the edit boot options, and it is not a simple third party editing tools, so in BCD can only use Bcdedit custom startup options. Bcdedit is a command line tool that edits BCD (starting configuration data). It has several functions, including creating new BCD, modifying existing BCD, and adding Startup menu options. The tool is included with the distribution in the%WINDIR%\System32 folder. You need administrator privileges to use Bcdedit. Note that Bcdedit is the default operating activities under the partition of \boot\BCD, even if no active partition drive or hidden partition, operations are still valid. To manipulate BCD for other paths, specify with the Bcdedit /store parameter.
3, create method: you must use Bcdboot.exe, the tools included in the%WINDIR%\System32 folder and distribution, it can be used from the Windows image (%WINDIR%\boot and%WINDIR%\System32) to create a startup environment file (the whole boot directory contains BCD, etc.) to the system partition, Windows7 installation disc in the "startup repair" is with this tool as the kernel, but due to the "startup repair" automatically, not according to regional settings, so by default the United States created automatically after the repair after the start menu is English. As for manual operation,
It's too complicated to be mastered.
(two) items and elements in BCD
There are only two items in BCD, that is, the startup manager and startup loader entries. The startup manager entry must have one and only one. The startup loader entry can have several (each startup loader entry corresponds to an operating system). The boot manager tab commands all startup loader entries. The subkey of an item is the element, also known as the item option.
(three) identifiers in BCD
Each entry and key element in BCD has a globally unique identifier for identifying and managing them. The identifier uses the GUID format ({xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}), where the X is sixteen decimal. The GUID identifier can be viewed by the Bcdedit /v command. To facilitate memory, Microsoft uses abbreviated forms to represent GUID identifiers for several specific items and elements. Execute Bcdedit (without arguments). If the following characters are shown, the corresponding item or element is displaying the GUID identifier in an abbreviated form.
{bootmgr} Windows startup manager entries
{default} defaults to start loader items
{ntldr} started the loader entry earlier than Vista's Windows
{current} startup loader items currently running
{globalsettings} verifies global settings (including verifying whether MBR has compatible BOOTMGR boot code)
{memdiag} memory diagnostics
{badmemory} RAM fault list
{dbgsettings} verifies the debugger running environment
{emssettings} verifies the running environment of emergency management services
{ramdiskoptions} verifies the RAM environment in which the startup manager runs
{bootloadersettings} verify boot loader runtime
{resumeloadersettings} verifies sleep recovery environment
{fwbootmgr} firmware startup manager entry (computer only for EFI specifications)
Below is the double zone (active partition without letter) with executive mode Bcdedit /v display Win7 BCD. In figure, BCD has two entries, a startup manager entry and a startup loader entry, note that three identifiers are enclosed in a box, and all computers that have the same value are the same.
Below is the double zone (active partition without letter) Win7 Bcdedit (with no parameters) for display mode BCD. The BCD in the diagram has two entries, a startup manager entry and a
startup loader entry, note the three identifiers that are enclosed in a box, and all computers that have Win7 are the same value.
(four) Bcdedit command parameter
Routine parameter
Parameter description
/ displays the BCDEdit command list. Running this command (without arguments) will display a summary of the available commands. To display detailed help for a specific command, run the Bcdedit / command, where the command is the name of the command that is searching for its details. For example, Bcdedit / createstore displays detailed help for the Createstore command.
The parameters used for the file
Parameter description
/createstore creates an empty BCD. The created BCD is not system BCD.
/export exports the contents of the system BCD to the file. This file can later be used to restore the status of the system BCD. This command is valid only for system BCD.
/import uses the backup data file generated from the previous /export option to restore the status of the system BCD. This
command will delete all existing items before the import of the system BCD occurs. This command is valid only for system BCD.
/store this option can be used with most BCDedit commands to specify the BCD to use. If this option is not specified, BCDEdit will operate on the system BCD. Running the Bcdedit /store command yourself is equivalent to running the Bcdedit /enum active command.
Such as:
1. create a BCD file named newstroe in the D disk
Bcdedit /createstore d:\newstroe
2. backup system BCD to d:\bcdbake file
Bcdedit /export d:\bcdbake
Three
Restore the d:\bcdbake file to system BCD
Bcdedit /import d:\bcdbake
Arguments for an item
Parameter description
/copy copies the startup loader entries specified in the same BCD. The boot manager entry cannot be copied.
/create creates a new null entry in BCD. If you are specifying an identifier that is currently in use, you cannot specify the /application, /inherit, and /device options. If the identifier is not specified or the specified identifier is not used, then the /application, /inherit, and /device options must be specified.
Syntax: Bcdedit /create [{}] /d
[-application ppt