刚用了一天的Vista,就被搞瘫了!
还有MBR也被改了,LINUX也启动不了
VISTA的系统引导技术,好好学吧!
原文地址:
Boot Configuration Data Editor Frequently Asked Questions
The Boot Configuration Data (BCD) store contains boot configuration parameters and controls how the operating system is started in Microsoft® Windows Vista™ and Microsoft® Windows Server® Code Name "Longhorn" operating systems. These parameters were previously in the Boot.ini file (in BIOS-based operating systems) or in the nonvolatile RAM (NVRAM) entries (in Extensible Firmware Interface–based operating systems). You can use the Bcdedit.exe command-line tool to affect the Windows® code which runs in the pre-operating system environment by adding, deleting, editing, and appending entries in the BCD store. Bcdedit.exe is located in the Windows System32 directory of the Windows Vista partition.
Note
Even though this document focuses primarily on Windows Vista, this information applies to both Windows Vista and Windows Server "Longhorn".
Note
For detailed command and option information at the command prompt, type bdedit.exe /? command. For example, type bcdedit.exe /? CREATESTORE.
Why was there a change to BCD from Boot.ini?
BCD was created to provide an improved mechanism for describing boot configuration data. With the development of new firmware models (for example, the Extensible Firmware Interface (EFI)), an extensible and interoperable interface was required to abstract the underlying firmware. This new design provides the foundation for a variety of new features in Windows Vista (for example, the Startup Repair tool and Multi-User Install shortcuts).
Where is the BCD file located in the registry?
• |
BIOS-based operating systems. The BCD registry file is located in the Boot Bcd directory of the active partition. |
• |
EFI–based operating systems. The BCD registry file is located on the EFI system partition. |
Can any user modify BCD?
No. You need administrative credentials to modify BCD.
What are the ways that I can modify BCD?
Depending on what you want to change, you can use the following tools to modify BCD:
• |
Startup and recovery. The Startup and recovery dialog box enables you to select the default operating system to start if you have multiple operating systems installed on your computer. You can also change the time-out value. These settings are located on the Advanced tab in the System Properties dialog box. |
• |
System Configuration utility (Msconfig.exe). Msconfig.exe is a more advanced tool with capabilities that include the following options: /debug, /safeboot, /bootlog, /noguiboot, /basevideo, and /numproc. |
• |
BCD WMI provider. The BCD Windows Management Instrumentation (WMI) provider is a management interface that you can use to script utilities that modify BCD. This is the only programmatic interface available for BCD. For more information, see Boot Configuration Data (BCD) at the (). |
• |
BCDEdit.exe. BCDEdit.exe is a command-line utility that replaces Bootcfg.exe in Windows Vista. For more information, see .
Note
You cannot use Bootcfg.exe to modify BCD. However, Bootcfg.exe will remain in the operating system in order to support older operating systems. |
Why don’t I see any Windows entries in the EFI boot manager? And why are there two boot managers?
All Windows entries are stored in the BCD store. On an EFI-based operating system, there is a single entry in the EFI firmware boot manager called “Windows Boot Manager”. This file is located in EFI Microsoft Boot Bootmgfw.efi. If you start Windows Boot Manager using the EFI boot manager, you should get a common look and feel on both your EFI-based and PC/AT-based operating systems. For example, the advanced boot options menu should work. The default timeout for the EFI boot manager is 2 seconds to make it easier to boot back and forth between Windows Server 2003 with Service Pack 1 and Windows Vista.
Yes. You can install Windows Vista on a different partition. It is best to install Windows Vista after you install the older operating systems. Older operating systems will continue to use Boot.ini for boot configuration.
Should I replace the code that used to work with Boot.ini to now use BCD on Windows Vista?
No. You will need to alter your code so that it uses Boot.ini for the older operating systems, and so that it uses BCD on Windows Vista.
In a multiboot environment, does modifying BCD on the pre-Windows Vista operating system modify the boot configuration?
No. You need to modify BCD to alter the boot configuration for Windows Vista. You also need to modify Boot.ini (for BIOS-based operating systems) or NVRAM (for EFI-based operating systems) to alter boot configuration for the older operating systems.
Can I disable BCD entirely when I am not booting to Windows Vista?
No. The boot manager for Windows Vista runs first to determine which operating system to start. Therefore, if you want to boot to the older operating system, you must set the default order to the older operating system in the BCD store. For more information, see .
You can use Bcdedit.exe to modify the Windows code which runs in the pre- operating system environment by adding, deleting, editing, and appending entries in the BCD store. Bcdedit.exe is located in the Windows System32 directory of the Windows Vista partition.
What can I do with Bcdedit.exe?
Bcdedit.exe currently enables you to do the following:
•Create a BCD store for a later installation of Windows Server "Longhorn".
•Add entries to a existing BCD store
•Modify existing entries in a BCD store.
•Delete entries from a BCD store.
•Export entries to a BCD store.
•Import entries from a BCD store.
•List currently active settings.
•Query entries of a particular type.
•Apply a global change (to all the entries).
•Change the default time-out value.
When I run bcdedit /enum, why do I get a Windows Boot Manager entry, a few Windows Boot Loader entries, and a legacy entry?
The boot environment has been split into two categories: Windows Boot Manager and various boot applications that run in the boot environment. Windows Boot Manager is basically a mini-operating system that controls your boot experience and enables you to choose which boot application to run. There are various boot applications (for example, Windows Boot Loader) and each one does something different. For example, a Windows Boot Loader application loads Windows.
When you specify /enum, you will get the following:
• |
One Windows Boot Manager entry (because there is only one boot manager). |
• |
A Windows Boot Loader application for each Windows Vista operating system you have installed on the computer. For example, if you have two different versions of Windows Vista installed on different partitions, you will see two Windows Boot Loader entries. |
• |
One legacy entry. This entry is not a boot application, but instead uses NTLDR and Boot.ini to boot into an operating system that is older than Windows Vista. You will use this entry to boot into Windows Server 2003, Windows XP, and earlier operating systems (if installed on the computer). |
Is there command-line Help for Bcdedit.exe?
Yes. For detailed command and option information at the command prompt, type bdedit.exe /? and bdedit.exe /? Command. For example, type bcdedit.exe /? CREATESTORE.
At the command prompt type:
bcdedit /dbgsettings DebugType [debugport:Port] [baudrate:Baud]
[channel:Channel] [targetname:TargetName]
|
|
Explanation |
|
Specifies the type of debugger. DebugType can be one of SERIAL, 1394 or USB. The remaining options
depend on the debugger type selected. |
|
|
|
|
|
|
|
|
Examples
The following command sets the global debugger settings to serial debugging
over com1 at 115,200 baud:
bcdedit /dbgsettings serial debugport:1 baudrate:115200
The following command sets the global debugger settings to 1394 debugging
using channel 23:
bcdedit /dbgsettings 1394 CHANNEL:32
The following command sets the global debugger settings to USB debugging
using target name "debugging":
bcdedit /dbgsettings USB targetname:debugging
How to check the debugger settings
At the command prompt, type:
bcdedit /enum Type /v
|
|
Explanation |
|
Specifies the type of entries to be listed. Type can be one of the following:
• |
|
• |
|
• |
|
• |
|
• |
|
• |
|
• |
For example, the following command lists all entries:
bcdedit /enum all /v
How to change the default operating system entry
At the command prompt, type:
bcdedit /default ID
|
|
Explanation |
|
Specifies the default GUID to be used when the time-out expires.
{466f5a88-0af2-4f76-9038-095b170dc21c} is the predefined GUID for NTLDR.
You can find the ID for a particular object by specifying bcdedit /enum all. |
Examples
The following command sets the specified entry as the default boot manager
entry:
bcdedit /default {cbd971bf-b7b8-4885-951a-fa03044f5d71}
The following command sets the legacy Windows loader (Ntldr) as the default
entry: {466f5a88-0af2-4f76-9038-095b170dc21c} is the predefined GUID for Ntldr.
bcdedit /default {466f5a88-0af2-4f76-9038-095b170dc21c}
How to change the boot sequence for the next reboot
At the command prompt, type:
bcdedit /bootsequence {ID} {ID} {ID} …
Examples
The following command sets the specified operating system as the default for the next restart. After that restart, it will be reset to DISPLAYORDER.
bcdedit /bootsequence {cbd971bf-b7b8-4885-951a-fa03044f5d71}
The following command sets two operating system entries and the
legacy Windows loader (Ntldr) in the boot manager one-time boot sequence:
bcdedit /bootsequnce {802d5e32-0784-11da-bd33-000476eba25f}
How to change boot manager time-out
To change the length of time the computer waits until the default operating system is selected, type the following:
bcdedit /timeout TimeOut
For example, the following command sets the boot manager TimeOut to 15 seconds:
bcdedit /timeout 15
How to set the boot manager display order
At the command prompt, type:
Bcdedit.exe /display {ID} {ID1} {ID2} …
or
Bcdedit.exe /displayorder {ID} [/addlast|/addfirst|/remove]
|
|
Explanation |
|
Specifies one GUID or a list of GUIDs that make up the display order. You must specify at least one ID.
For more information about identifiers, type bcdedit /? ID. |
Examples
The following command sets three operating system entries in the boot manager display order:
Bcdedit.exe /displayorder {c84b751a-ff09-11d9-9e6e-0030482375e6} {c74b751a-ff09-11d9-9e6e-0030482375e4} {c34b751a-ff09-11d9-9e6e-0030482375e7}
The following command sets two operating system entries and the legacy Windows loader in the boot manager display order:
bcdedit /displayorder {802d5e32-0784-11da-bd33-000476eba25f}
The following command adds the entry represented by the GUID to end of the boot menu display order.
bcdedit.exe /displayorder {c84b751a-ff09-11d9-9e6e-0030482375e6}-addlast
How to delete a boot entry
At the command prompt, type:
bcdedit /delete ID [/f]
|
|
Explanation |
|
Specifies the GUID of the boot entry you want to delete. If ID is not specified, the current boot entry ID will be deleted.
If you specify a well-known GUID, you will have to force the deletion by specifying /f. For example:
bcdedit /delete {default} /f |
For example, the following command deletes the entry with id {802d5e32-0784-11da-bd33-000476eba25f}.
bcdedit /delete {802d5e32-0784-11da-bd33-000476eba25f}
How to turn the kernel debugger on or off
At the command prompt, type:
bcdedit /debug [{ID}] {on|off}
|
|
Explanation |
|
ID is not specified, it modifies the current boot entry ID. |
For example, the following command enables boot debugging for the specified operating system boot entry:
bcdedit /debug {cbd971bf-b7b8-4885-951a-fa03044f5d71} on
Note
For more information about IDs, run bcdedit /? ID.
How to set Physical Address Extension (PAE)
At the command prompt, type:
bcdedit /set {ID} pae [Default|ForceEnable|ForceDisable]
|
|
Explanation |
|
ID, the current operating system settings will be modified. |
For example:
bcdedit /set {802d5e32-0784-11da-bd33-000476eba25f} pae forceenable
How to set REMOVEMEMORY
At the command prompt, type the following. Removememory removes memory from the total available memory that the operating system can use.
bcdedit /set {GUID} removememory bytes
|
|
Explanation |
|
ID of the operating system entry you want to change. If you do not specify ID, the current operating system settings will be modified. |
|
|
Example
This example removes 256 MB of memory from the total available:
bcdedit /set {802d5e32-0784-11da-bd33-000476eba25f } removememory 256
How to set MAXMEM/TRUNCATEMEMORY
At the command prompt, type the following. Truncatememory disregards all memory at or above the specified physical address.
bcdedit /set {ID} truncatememory bytes
Note
We recommend that you use removememory instead. It does a better job of restricting the operating system to use the specified memory while accounting for memory holes.
|
|
Explanation |
|
ID of the operating system entry you want to change. If you don't specify ID, the current operating system settings will be modified. |
|
|
Example
This example sets the truncate memory to 1024 MB:
bcdedit /set {802d5e32-0784-11da-bd33-000476eba25f} truncatememory 1073741824
How to add a private kernel
At the command prompt, type:
bcdedit /set {ID} kernel "Path"
|
|
Explanation |
|
ID, then the current operating system settings will be modified. |
For example:
bcdedit /set {802d5e32-0784-11da-bd33-000476eba25f} kernel "mykrnl.dll"
How to create a new Windows Vista operating system entry
To create a new Windows Vista operating system entry, use the following procedure:
To create a new Windows Vista operating system entry
1. |
First, copy the operating system entry you want to replicate and name it NewEntryDescription.
bcdedit /copy {GuidToCopy} /d “NewEntryDescription” |
2. |
This command will split the new GUID. Use the new GUID to modify the partition information by specifying:
bcdedit /set {NewGuid} device partition=x:
bcdedit /set {NewGuid} osdevice partition=x: |
3. |
Add the new operating system entry created to the display by specifying:
bcdedit /displayorder {NewGuid} /addlast |
How to list entries of a particular type
The /enum command lists entries in the BCD store. To list entries, type:
bcdedit /enum [Type]
|
|
Explanation |
|
Specifies the type of entries to list. Type can be one of the following:
|
Examples
The following command lists all operating system loader boot entries:
bcdedit /enum osloader
The following command lists all boot manager entries:
bcdedit /enum bootmgr
How to modify BCD when installing a previous version of Windows onto a computer running Windows Vista
To install an older Windows operating system on a computer running Windows Vista, use the following procedure.
To install a previous version of Windows onto a computer running Windows Vista
1. |
Install the previous version of Windows. |
2. |
Log on to the older operating system and restore the latest boot manager by running the following. Fixntfs.exe will be in the boot directory of the active partition.
fixntfs /lh |
3. |
Create a BCD entry for the older operating system by specifying the following. Bcdedit.exe is located in the Windows System32 directory of the Windows Vista partition. Description is the description of the new entry for the older operating system.
Bcdedit /create {legacy} /d “Description”
Bcdedit /set {legacy} device boot
Bcdedit /set {legacy} path ntldr
Bcdedit /displayorder {legacy} /addlast |
4. |
Restart the computer in order for the changes to take effect. |
How to create an entry to boot a WIM image from a hard disk
To create an entry to boot a Windows Imaging Format (WIM) image, you will need to create an OSloader type entry with RAMDISK options pointing to the boot partition. To do this, use the following procedure. In this procedure, the arcpath multi(0)disk(0)rdisk(0)partition(1) refers to the C: drive on the computer, and Boot.wim is a regular Boot.wim with Winload.exe in the System32 folder inside the WIM image.
To create an entry to boot a WIM image from hard disk
1. |
Create the {ramdisktoptions} object in your BCD store by specifying the following. Drive should be the drive that contains the image.
bcdedit /create {ramdiskoptions} /d "Ramdisk options"
bcdedit /set {ramdiskoptions} ramdisksdidevice partition=Drive
bcdedit /set {ramdiskoptions} ramdisksdipath boot boot.sdi |
2. |
Create a new boot application entry by specifying:
bcdedit /create /d "Boot from WIM" /application OSLOADER |
3. |
This will return an identifier (GUID) for the newly created entry. This new entry will be referred to as {GUID} in the rest of this procedure. Next specify the following:
bcdedit /set {GUID} device ramdisk=[c:] sources boot.wim,{ramdiskoptions}
bcdedit /set {GUID} path windows system32 winload.exe
bcdedit /set {GUID} osdevice ramdisk=[c:] sources boot.wim,{ramdiskoptions}
bcdedit /set {GUID} systemroot windows |
4. |
If you are booting into Windows Preinstallation Environment (Windows PE), then you will also need to specify:
bcdedit /set {GUID} winpe yes
bcdedit /set {GUID} detecthal yes |
5. |
Next specify the following to add your new entry to the display order:
bcdedit /displayorder {GUID} /addlast |
How to change the debugger settings of a specific entry
To override the global entry for a specific debugger setting, type one of the following.
Note
This command does not enable or disable the debugger for the specific boot entry.
• |
To set serial debugging, type:
bcdedit /set {GUID} debugtype:serial
bcdedit /set {GUID} baudrate:Baudrate
bcdedit /set {GUID} debugport:Port |
• |
To set USB debugging, type:
bcdedit /set {GUID} debugtype:usbbcdedit /set {GUID} targetname:debugging |
• |
To set 1394 debugging, type:
bcdedit /set {GUID} debugtype:1394bcdedit /set {GUID} targetname:32 |
Example
The following command sets the debugger setting for c74b751a-ff09-11d9-9e6e-0030482375e4 to serial debugging over com1 at 115,200 baud:
Bcdedit /set {c74b751a-ff09-11d9-9e6e-0030482375e4} debugtype:serial
Bcdedit /set {c74b751a-ff09-11d9-9e6e-0030482375e4} baudrate:115200
Bcdedit /set {c74b751a-ff09-11d9-9e6e-0030482375e4} debugport:1 | |