Windows Server 2012 Overview : Boot Configuration (part 3) – Managing the Boot Configuration Data store and its entries – Viewing BCD entries

4. Managing the Boot Configuration Data store and its entries

BCD Editor (BCDEdit.exe) is an advanced command-line tool for viewing and manipulating the configuration of the pre-operating system boot environment. Although I discuss tasks related to modifying the BCD data store in the sections that follow, you should attempt to modify the BCD store only if you are an experienced IT pro. As a safeguard, you should make a full backup of the computer prior to making any changes to the BCD store. Why? If you make a mistake, your computer might end up in a nonbootable state and you would then need to initiate recovery.

4.1 Viewing BCD entries

Computers can have system and nonsystem BCD stores. The system BCD store contains the operating system boot entries and related boot settings. Whenever you work with the BCD Editor, you will be working with the system BCD store.

On a computer with only one operating system, the BCD entries for your computer will look similar to those in Example 1. As the listing shows, the BCD store for this computer has two entries: one for the Windows Boot Manager and one for the Windows Boot Loader. Here, the Windows Boot Manager calls the boot loader and the boot loader uses Winload.exe to boot Windows Server 2012.

Example 1. Entries in the BCD store on a single boot computer
Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=F:
description             Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
bootshutdowndisabled    Yes
default                 {current}
resumeobject            {5824ba7d-acee-11e1-ba52-cfa3fef36259}
displayorder            {current}
toolsdisplayorder       {memdiag}
timeout                 30

Windows Boot Loader
-------------------
device                  partition=C:identifier              {current}
path                    \Windows\system32\winload.exe
description             Windows Server 2012
locale                  en-US
inherit                 {bootloadersettings}
recoverysequence        {5824ba7f-acee-11e1-ba52-cfa3fef36259}
recoveryenabled         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \Windows
resumeobject            {5824ba7d-acee-11e1-ba52-cfa3fef36259}
nx                      OptOut

BCD entries for Windows Boot Manager and Windows Boot Loader have similar properties. These properties include those summarized in Table 3.

Table 3. BCD entry properties
PropertyDescription
DescriptionShows descriptive information to help identify the type of entry.
DeviceShows the physical device path. For a partition on a physical disk, you’ll see an entry such as partition=C:.
FileDeviceShows the path to a file device, such as partition=C:.
FilePathShows the file path to a necessary file, such as \hiberfil.sys.
IdentifierShows a descriptor for the entry. This can be a boot loader application type, such as BOOTMGR or NTLDR. Or it can be a reference to the current operating system entry or the GUID of a specific object.
InheritShows the list of entries to be inherited.
LocaleShows the computer’s locale setting, such as en-us. The locale setting determines the UI language shown. In the \Boot folder, there are locale subfolders for each locale supported, and each of these subfolders has language-specific UI details for the Windows Boot Manager (BootMgr.exe) and the Memory Diagnostics Utility (MemDiag.exe).
OSDeviceShows the path to the operating system device, such as partition=C:.
PathShows the actual file path to the boot loader application, such as \Windows\System32\winresume.exe.

When you are working with the BCD store and BCD Editor, you’ll see references to well-known identifiers, summarized in Table 4, as well as globally unique identifiers (GUIDs). When a GUID is used, the GUID has the following format where each N represents a hexadecimal value:

{NNNNNNNN-NNNN-NNNN-NNNN-NNNNNNNNNNNN}

Such as:

{5824ba7d-acee-11e1-ba52-cfa3fef36259}

The dashes that separate the parts of the GUID must be entered in the positions shown.

Table 4. Well-known identifiers
IdentifierDescription
{badmemory}Contains the global RAM defect list that can be inherited by any boot application entry.
{bootloadersettings}Contains the collection of global settings that should be inherited by all Windows boot loader application entries.
{bootmgr}Indicates the Windows boot manager entry.
{current}Represents a virtual identifier that corresponds to the operating system boot entry for the operating system that is currently running.
{dbgsettings}Contains the global debugger settings that can be inherited by any boot application entry.
{default}Represents a virtual identifier that corresponds to the boot manager default application entry.
{emssettings}Contains the global Emergency Management Services settings that can be inherited by any boot application entry.
{fwbootmgr}Indicates the firmware boot manager entry. This entry is used on EFI systems.
{globalsettings}Contains the collection of global settings that should be inherited by all boot application entries.
{hypervisorsettings}Contains the hypervisor settings that can be inherited by any operating system loader entry.
{legacy}Indicates the Windows Legacy OS Loader (Ntldr) that can be used to start operating systems earlier than Windows Vista.
{memdiag}Indicates the memory diagnostic application entry.
{ntldr}Indicates the Windows Legacy OS Loader (Ntldr) that can be used to start operating systems earlier than Windows Vista.
{ramdiskoptions}Contains the additional options required by the boot manager for RAM disk devices.
{resumeloadersettings}Contains the collection of global settings that should be inherited by all Windows resume from hibernation application entries.

When a computer has additional Windows Vista, Windows Server 2008, or later operating systems installed, the BCD store for it has additional entries for each additional operating system. For example, the BCD store might have one entry for the Windows Boot Manager and one Windows Boot Loader for each operating system.

When a computer has a legacy operating system installed, the BCD store has three entries: one for the Windows Boot Manager, one for the Windows Legacy OS Loader, and one for the Windows Boot Loader. Generally, the entry for the Windows Legacy OS Loader will look similar to Example 2.

Example 2. Sample Legacy OS Loader entry
Windows Legacy OS Loader
------------------------
identifier:             {ntldr}
device:                 partition=C:
path:                   \ntldr
description:            Earlier version of Windows

Although the Windows Boot Manager, Windows Legacy OS Loader, and Windows Boot Loader are the primary types of entries that control startup, the BCD also stores information about boot settings and boot utilities. The Windows Boot Loader entry can have parameters that track the status of boot settings, such as whether No Execute (NX) policy is set for Opt In or Opt Out. The Windows Boot Loader entry also can provide information about available boot utilities, such as the Memory Diagnostics utility.

To view the actual value of the GUIDs needed to manipulate entries in the BCD data store, type bcdedit /v at an elevated command prompt.

4.2 Creating and identifying the BCD data store

Using BCD Editor, you can create a new, nonsystem BCD data store by using the following command:

bcdedit /createstore StorePath

Here StorePath is the actual folder path to the location where you want to create the nonsystem store, such as:

bcdedit /createstore c:\non-sys\bcd

On an EFI system, you can temporarily set the system store device using the /sysstore command. Use the following syntax:

bcdedit /sysstore StoreDevice

Here StoreDevice is the actual device identifier store, such as:

bcdedit /sysstore C:

Note

The device must be a system partition. Note this setting does not persist across reboots and is used only in cases where the system store device is ambiguous.

4.3 Importing and exporting the BCD data store

BCD Editor provides separate commands for importing and exporting the BCD store. You can use the /export command to export a copy of the system BCD store’s contents to a specified folder. Use the following command syntax:

bcdedit /export StorePath

Here StorePath is the actual folder path to which you want to export a copy of the system store, such as:

bcdedit /export c:\backup\bcd

To restore an exported copy of the system store, you can use the /import command. Use the following command syntax:

bcdedit /import ImportPath

Here ImportPath is the actual folder path from which you want to import a copy of the system store, such as:

bcdedit /import c:\backup\bcd

On an EFI system, you can add /clean to the import to specify that all existing firmware boot entries should be deleted. Here is an example:

bcdedit /import c:\backup\bcd /clean

4.4 Creating, copying, and deleting BCD entries

BCD Editor provides separate commands for creating, copying, and deleting entries in the BCD store. You can use the /create command to create identifier, application, and inherit entries in the BCD store.

As shown previously in Table 4, BCD Editor recognizes many well-known identifiers, including {dbgsettings} used to create a debugger settings entry, {ntldr} used to create a Windows Legacy OS entry, and {ramdiskoptions} used to create a RAM disk additional options entry. To create identifier entries, you use the following syntax:

bcdedit /create Identifier /d "Description"

Here Identifier is a well-known identifier for the entry you want to create, such as:

bcdedit /create {ntldr} /d "Earlier Windows OS Loader"

You can create the following entries for specific boot-loader applications as well:

  • Bootsector A real-mode, boot-sector application, used to set the boot sector for a real-mode application
  • OSLoader An operating-system loader application, used to load a Windows Vista or later operating system
  • Resume A Windows Resume Loader application, used to resume the operating system from hibernation
  • Startup A real-mode application, used to identify a real-mode application

Use the following command syntax:

bcdedit /create /application AppType /d "Description"

Here AppType is one of the previously listed application types, such as:

bcdedit /create /application osloader /d "Windows 8"

You can delete entries in the system store using the /delete command and the following syntax:

bcdedit /delete Identifier

If you are trying to delete a well-known identifier, you must use the /f command to force deletion, such as:

bcdedit /delete {ntldr} /f

By default, when using the /delete command, the /cleanup option is implied, and this means BCD Editor cleans up any other references to the entry being deleted. This ensures that the data store doesn’t have invalid references to the identifier you removed. Because entries are removed from the display order as well, this can result in a different default operating system being set. If you want to delete the entry and clean up all other references except the display order entry, you can use the /nocleanup command.

Windows Server 2012 Overview : Boot Configuration (part 1) – Boot from hardware and firmwareWindows Server 2012 Overview : Boot Configuration (part 2) – Boot environment essentials, Managing startup and boot configuration

Windows Server 2012 Overview : Boot Configuration (part 4) – Managing the Boot Configuration Data store and its entries – Setting BCD entry values

Windows Server 2012 Overview : Boot Configuration (part 5) – Managing the Boot Configuration Data store and its entries – Changing the operating system display order