daknetworks.com

You are here: Blog BCD Replaces Boot.ini

BCD Replaces Boot.ini

Twice this week I've been bitten by the BCD or BOOT CONFIGURATION DATA.

BCD replaces the BOOT.INI file in older systems such as XP. BCD is found in WINDOWS VISTA and newer systems. The BCD is a OPERATING SYSTEM FILE and will be hidden unless the options are set to view those files:

  • -open any EXPLORER window.
  • -click ORGANIZE > FOLDERS & SEARCH OPTIONS
  • -click the VIEW tab (at the top).
  • -uncheck HIDE PROTECTED OPERATING SYSTEM FILES.
  • -click OK.

Previously, there was a boot.ini file. To edit the boot.ini file, simply edit the file with a text editor. Now to edit the BCD, you must use BCDEdit.exe.

The overall problem becomes that the BCD is unreliable (hence the name Microsoft). It causes issues like:

"the trust relationship between this workstation and the primary domain failed" in WINDOWS 7
(bcdedit /set S:\Boot\BCD {default} bootstatuspolicy ignoreallfailures)

and

"inaccessible boot device" WINDOWS 8.1
(Bcdedit /store S:\BOOT\BCD /set {default} truncatememory 4294967296)
(T:\windows\system32\bcdedit /store S:\boot\bcd /set {default} truncatememory 4294967296)

Both require edits to the BCD. But how do you edit the BCD when the system isn't accessible?

 


How to Edit the BCD

The BCD is actually a file in a small hidden directory. If you could connect the external drive to a working system and assign the letter S to the drive, the file location would be:

S:\Boot\BCD

Please note that this is NOT the WINDOWS OS partition. This is a small NTFS partition (100MB for WINDOWS 7 & 300MB for WINDOWS 8) before the the WINDOWS OS partition. This partition is marked as ACTIVE and will therefore be chosen as the partition to boot from.

This is really confusing because there is a T:\Boot\BCD as well.

True to MS standard, they put out way too much unnecessary jargon here:http://technet.microsoft.com/en-us/library/cc721886%28WS.10%29.aspx#BKMK_bcdedit

  • -connect the harddisk with the corrupt BCD into another computer that is running Windows.
  • -mount the defective partition on a drive (in my case S:\)
  • -in the partition the file S:\Boot\BCD is the one that needs to be repaired.
  • -open a command prompt (Cmd.exe) (as administrator)
  • -type: T:\Windows\System32\bcdedit /store S:\Boot\BCD /enum
  • -you are viewing the BCD.
  • -to view everything in the BCD...
  • -type: T:\Windows\System32\bcdedit /store S:\Boot\BCD /enum all

 


How to Edit Some of the BCD Settings:

The BCD will have a BOOT-MANAGER called BOOTMGR. This is a boot manager for the entire disk. You can think of it as a GRUB, LILO, GRUB4DOS, etc or any other bootloader. It can be used to redirect the boot the MAIN WINDOWS OS but it can also boot other OS's as well. Most people won't get this far. They just want their MAIN WINDOWS OS to boot correctly.

After the BOOTMGR section, comes all the WINDOWS OS sections. Typically, the main section will be called DEFAULT and it will show as {default}.
(NOTE: don't let the curly brackets scare you).

For example, if you wanted to change the BOOTMGR device and the DEFAULT device, here's how.
(Please do not type this in... This is just an example.)

T:\Windows\System32\bcdedit /store S:\Boot\BCD /set {bootmgr} device boot
T:\Windows\System32\bcdedit /store S:\Boot\BCD /set {default} device boot
T:\Windows\System32\bcdedit /store S:\Boot\BCD /set {default} osdevice boot

This will change the settings for those key values.

You can also use an awesome handy tool called VISUAL BCD EDITOR located at: http://www.boyans.net

 


Fix the BCD

If you would like to rebuild the BCD, here's how:

  1. Put the Windows Vista or Windows 7 or Windows 8 media in the DVD drive / usb, and then start the computer.
  2. Press a key when you are prompted.
  3. Select a language, a time, a currency, a keyboard, or an input method, and then click Next.
  4. Click Repair your computer.
  5. Select the operating system that you want to repair, and then click Next.
  6. In the System Recovery Options dialog box, click Command Prompt.
  7. Type Bootrec.exe, and then press Enter.

That will automatically try and fix the BCD if it's broken.

 


Rebuild the BCD

Same as fixing the BCD above but using switches at the end.

Bootrec.exe /FixMbr
Bootrec.exe /FixBoot
Bootrec.exe /ScanOs
Bootrec.exe /RebuildBcd

 


WINDOWS 8.1 Considerations

WINDOWS 8.1 installs a hidden 300MB NTFS partition.

If WINDOWS is loaded, some may investigate and fiddle around with the BCD on the main partition in C DRIVE not realizing that the BCD loading in another hidden partition for the purpose of the BCD.

If you boot from a CD/USB, the BCD PARTITION will be the C DRIVE and the WINDOWS OS PARTITION will be the D DRIVE.

 


BCDEDIT Says zero Total Identified Windows installations

If you get as far as: Bootrec.exe /ScanOs

And it says:

"zero Total Identified Windows installations: 0"

Then you may have to rebuild the BCD. Be sure to backup the original BCD first.

  • boot from a WINDOWS VISTA/7/8 media as above.
  • cd c:\boot (note that this is not the normal C DRIVE. If you boot from a WINDOWS 7 or WINDOWS 8 install disk, the disk will see all the partitions and LETTER them accordingly. The C DRIVE will be the BCD partition and the D DRIVE will be the WINDOWS partition.)
  • bcdedit /export c:\bcdbackup
  • attrib c:\boot\bcd -h -r -s
  • ren c:\boot\bcd bcd.old
  • bootrec /rebuildbcd
  • type: Y
  • press: ENTER

You should get some kind of awesome message to let you know that it is rebuilt correctly.

Contact Dak Networks

We are not taking on new clients at this time.