Windows Server 2008 - BCD and BCDEdit

on 10/04/2008 02:13:00 AM

Windows Server 2008 - BCD and BCDEdit

Boot।ini really was the last of Microsoft's .ini files. In Windows Server 2008, Boot.ini is superseded by BCD (Boot configuration data). Boot Configuration Data is a wonderfully descriptive expression, more importantly, it gives you control of what should happen when a Windows Server 2008 computer starts. The BCD editor is not notepad, but a command-line program called BCDEDIT.

Difficulty getting started with BCDEdit

At the beginning I found it frustrating when I tried to set, or even change boot settings with BCDEdit. My aim on this page is to provide you with strategies and detailed examples, as a result, you will soon learn how to editor the menu which appears when Windows Server 2008 boots. Incidentally, the same techniques work with Vista.

Scenario: We want to inspect, and then change the Windows Server 2008's boot options. For example, reduce the timeout, or display an option to boot into a second operating system on a dual-boot machine.

Example 1 - Plain bcdedit

Trap: Before launching the command prompt, right click CMD and select, RunAs, administrator.

Let us get started with plain:
bcdedit

Here is the BCD code

Windows Boot Manager
--------------------

identifier {bootmgr}
device partition=C:
description Windows Boot Manager
locale en-US
inherit {globalsettings}
default {default}
displayorder {current}
{3b1cb4c9-5398-11dd-88aa-a0b620d5ce11}
toolsdisplayorder {memdiag}
timeout 7

Windows Boot Loader
-------------------
identifier {current}
device partition=C:
path \Windows\system32\winload.exe
description Microsoft Windows Server 2008
locale en-US
inherit {bootloadersettings}
osdevice partition=C:
systemroot \Windows
resumeobject {default}
nx OptOut

Windows Boot Loader
-------------------
identifier {3b1cb4c9-5398-11dd-88aa-a0b620d5ce11}
device partition=D:
path \Windows\system32\winload.exe
description Microsoft Windows Vista
locale en-US
inherit {bootloadersettings}
osdevice partition=D:
systemroot \Windows
resumeobject {3b1cb4ca-5398-11dd-88aa-a0b620d5ce11}
nx OptIn

Note 1: Observe three sections of BCD code, one for the boot manager itself, followed by sections for the operating systems, in this instance Windows Server 2008 and Vista.

Note 2: You could also append the verbose switch /v. The advantage is that you can now see the GUID of the default identifier.

Example 2 - Collect information about the switches

Making changes to BCD code is possible, but beware, your mind has to adjust to its logic and moreover, the syntax is tricky particularly with the hex code. The biggest problem at the outset is to sift the important commands from a long list.

Let us ask for help identifying bcdedit's switches, we can try the famous switch /?
bcdedit /?

Here is an excerpt:

BCDEDIT - Boot Configuration Data Store Editor

Commands that control the boot manager
======================================
/bootsequence Sets the one-time boot sequence
/default Sets the default entry to boot.
/displayorder Sets the order in the multiboot menu.
/timeout Sets the boot manager time-out value.

Note 1: Try bcdedit /? TOPICS

Example 3 - How to Edit BCD Settings

bcdedit /timeout

I would like to start with /timeout, because it's the easiest change to understand and to monitor.

Here is an easy change:
bcdedit /timeout 7

To see the effect, re-run this plain command: bcdedit

bcdedit /default

Here is the classic switch to control what happens after the timeout expires.

bcdedit /default {GUID}

bcdedit /default {3b1cb4c9-5398-11dd-88aa-a0b620d5ce11}

Note 1: In the above example setting the /default in this way changes the bcd code, as a result my computer now boots into Vista. Just to remind you that tweaking the default GUID only makes sense if you have a multi-boot machine.

bcdedit /displayorder

The key point with /displayorder is that you can only use particular GUIDs, furthermore, they must be encased in curly brackets. The knack is to research for GUIDs in sections starting with:

Windows Boot Loader
-------------------
identifier {3b1cb4c9-5398-11dd-88aa-a0b620d5ce11}

Tip: To save typos you can 'Mark', 'Copy' and 'Paste' these hex blocks at the command-line. Click on the tiny icon at the top left of your cmd box, then select 'Edit ->'

Trap: The GUIDs must exist, you cannot just make them up. Moreover they must correspond to real settings as indicated under 'identifier'.

Example 1:
bcdedit /displayorder generic syntax {GUID-os1} {GUID-os2}
bcdedit /displayorder {current} {3b1cb4c9-5398-11dd-88aa-a0b620d5ce11}

Example 2:
bcdedit /displayorder {3b1cb4c9-5398-11dd-88aa-a0b620d5ce11} {9f25ee7a-e7b7-11db-94b5-f7e662935912}

I say again, you must use your GUIDs, and not mine; test by re-running the command: bcdedit. The key point is to synchronize with the rhythm of the syntax,
/displayorder space curly bracket os1 curly bracket space curly bracket os2 curly bracket.

bcdedit /set

It is possible to make cosmetic changes to the descriptions that appear alongside the operating systems on the boot menu.

Example 1
bcdedit /set {50487680-538e-11dd-9786-b25b83bcddca} description "Longhorn"

bcdedit /bootsequence

At present I have no use for this bootsequence switch, however, I did once see its effect when bootmgr asked me if I wished to roll-back an update I was about to make.


Well Known GUIDs for BCDEdit

Apparently, these GUIDs are well known to the bootmgr, although this bcd code is not well known by me!

{5048767f-538e-11dd-9786-b25b83bcddca} (Meaning Windows Server 2008)

{3b1cb4c9-5398-11dd-88aa-a0b620d5ce11} (Meaning BCD for Vista)

{cbd971bf-b7b8-4885-951a-fa03044f5d71} (Another Vista GUID)

{466f5a88-0af2-4f76-9038-095b170dc21c} (Meaning BCD XP)

Further Information

On this page I have concentrated on amending the Windows Server 2008 boot menu on a dual boot machine. BCDEdit has more wide ranging capabilities, in particular '/copy' for creating more Windows Boot Loader sections. While that may be useful for preparing imaging software, there is no point in complicating matters on a regular server by creating references to non-existent operating systems.

My scenario deals with cases where you have installed two or more operating systems on the same computer and now you need to control or troubleshoot what happens when the machine boots. Such control was formerly the province of boot.ini.

Perhaps the next step would be to investigate the

Summary of BCDEdit

If you are wondering how to control the boot menu that you see in Windows Server 2008 or Vista, then investigate the command-line bcdedit. There are switches to control the timeout and the display order for multi-boot machines.

Guy recommends: Auditing Server 2008 with ObserveITObserveIT

ObserveIT delivers one of the most awaited features in server based computing, namely session recording। You can monitor what was done, by whom, when and on which server. ObserveIT's unique feature is that it captures metadata; the advantage is that you can home in on a particular time-frame without having to replay the whole recording.
See the demo and download your evaluation copy

1 comments:

Anonymous said...

In an amazing coincidence, the guy at the following link wrote an article two years after yours that is identical word-for-word to yours!

http://www.tomsitpro.com/articles/windows_administration-windows_server_2008-boot_configuration_data,2-109.html