4

Looks like my BCD is somehow broken but I can't figure out what is wrong. The system boots just fine but it prevents windows from installing updates:

MoSetupPlatform: Opening BCD store...
CDlpActionDiskSpaceReq::CalculateRequiredDiskSpaceInstallReq(1752): Result = 0x8007001F

I'm running Windows 10 on a MacBook (bootcamp), it uses EFI partition table. When I run bcdedit /enum in elevated prompt I get

The boot configuration data store could not be opened.
A device attached to the system is not functioning.

When I try to open store directly, it opens just fine:

B:\>bcdedit.exe /store B:\EFI\Microsoft\Boot\BCD /enum

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=B:
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
default                 {default}
resumeobject            {8b3fea76-03c8-11e6-8f47-dc08058a457d}
displayorder            {default}
toolsdisplayorder       {memdiag}
timeout                 30

Windows Boot Loader
-------------------
identifier              {default}
device                  partition=C:
path                    \WINDOWS\system32\winload.efi
description             Windows 10
locale                  en-US
inherit                 {bootloadersettings}
recoverysequence        {8b3fea78-03c8-11e6-8f47-dc08058a457d}
displaymessageoverride  Recovery
recoveryenabled         Yes
isolatedcontext         Yes
allowedinmemorysettings 0x15000075
osdevice                partition=C:
systemroot              \WINDOWS
resumeobject            {8b3fea76-03c8-11e6-8f47-dc08058a457d}
nx                      OptIn
bootmenupolicy          Standard

Does Windows store actual BCD somewhere else? How does windows know on which partition and path to look for system BCD store?

How do I diagnose what is wrong with my BCD store?

update: forgot that I boot using refind bootloader which likely boots bootmgfw.efi

Poma
  • 1,806
  • 6
  • 24
  • 31
  • “Does Windows store actual BCD somewhere else? ” - Nope it’s stored on the EFI partition. Why are you mounting and assigning a drive letter to your EFI partition? – Ramhound Oct 21 '17 at 00:19
  • And the full path is always `EFI\Microsoft\Boot\BCD`? – Poma Oct 21 '17 at 00:21
  • The EFI partition shouldn’t have a drive letter. The answer to your question is that for UEFI systems it is indeed: https://technet.microsoft.com/en-us/library/cc721886(v=ws.10).aspx – Ramhound Oct 21 '17 at 00:32
  • 1
    I've temporarily mounted it to B: to easier troubleshoot this issue. But if both commands try to open the same file, how come that one succeeds and the other fails? – Poma Oct 21 '17 at 00:45

4 Answers4

3

One situation in which the system will boot but bcdedit /enum will fail is if the EFI boot partition has the wrong partition type. As a side note, this may also cause reagentc /enable to fail and may additionally prevent Windows updates from installing successfully.

You can check whether this is your problem with the diskpart command. Assuming you have only one hard disk drive,

select disk 0
list partition

You should see something like this:

  Partition ###  Type              Size     Offset
  -------------  ----------------  -------  -------
  Partition 1    System             500 MB  1024 KB
  Partition 2    Primary            445 GB   501 MB

(There may or may not be a third "Recovery" partition as well.)

The smaller partition named "System" is the one you want, usually partition 1, so

select partition 1
detail partition

And you should see something like this

Partition 1
Type    : c12a7328-f81f-11d2-ba4b-00a0c93ec93b
Hidden  : Yes
Required: No
Attrib  : 0XC000000000000000
Offset in Bytes: 1048576

  Volume ###  Ltr  Label        Fs     Type        Size     Status     Info
  ----------  ---  -----------  -----  ----------  -------  ---------  --------
* Volume 3                      FAT32  Partition    500 MB  Healthy    System

If the file system is not FAT32 then you are not looking at the right partition. It should also be Hidden, and will not usually have a drive letter assigned unless (as in the originally posted question) it has been explicitly given one for troubleshooting purposes. It might not be exactly 500MB, but should only be taking up a small fraction of the hard disk.

The type of the EFI partition should be c12a7328-f81f-11d2-ba4b-00a0c93ec93b as shown above. If it is not, and in particular if it is ebd0a0a2-b9e5-4433-87c0-68b6b72699c7 (see Microsoft Basic Data Partition on Wikipedia) then that is likely to be the cause of the problem.

Addendum: if the current type of the partition is 07 or any two hexadecimal digits, the disk is partitioned in MBR mode rather than EFI mode and this answer is inapplicable.

If the partition type is incorrect, you can fix this with the set id command,

set id=c12a7328-f81f-11d2-ba4b-00a0c93ec93b

The bcdedit /enum command should then work.

Harry Johnston
  • 5,754
  • 7
  • 30
  • 55
  • set id send this error: `the specified type is not in the correct format` (I tripple checked the string) (can't boot, few days after win10 v2004: black screen with high cpu) – JinSnow Aug 23 '20 at 12:49
  • @JinSnow, perhaps the disk is partitioned in MBR rather than EFI mode. What is the current type of the partition as shown in "detail partition"? – Harry Johnston Aug 23 '20 at 22:28
  • thanks for your reply. It seems to be faulty hard drive (I'm installing windows on another drive to check this hypothesis) – JinSnow Aug 24 '20 at 05:45
  • thanks for your reply. It was probably a faulty hard drive (details: https://superuser.com/a/1584467/235752 ) – JinSnow Sep 10 '20 at 16:26
  • Amazing! Thanks! I had converted my machine from MBR to GPT and along the way, the partition type got messed up. I can now do Windows Updates again and bcdedit works again. Thanks! – Xebozone May 20 '23 at 11:33
1

Looks like OS X makes some changes that are incompatible and break bcdedit. Here's how I was able to temporarily fix this issue: reset NVRAM with +Alt+P+R, then boot directly into windows partition by holding Alt. I was able to install windows updates but after I booted into OS X and installed updates, bcdedit became broken again.

Poma
  • 1,806
  • 6
  • 24
  • 31
0

Same problem after migration to new ssd (boot via efi-partition \efi\microsoft\boot\bcd to win10)

bcdedit /enum cannot open system store (BCD), error:

The boot configuration data store can not be opened. The requested system device cannot be found.

(german: Der Speicher für die Startkonfigurationsdaten konnte nicht geöffnet werden. Das angeforderte Systemgerät kann nicht gefunden werden.)

PROBLEM is:

the partition-type of the efi-partition is wrong

(often msftdata, partition-id=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7)

has to be esp (efi start partition, partition-id=c12a7328-f81f-11d2-ba4b-00a0c93ec93b)

further symptoms:

Hibernation does not work.

BCD is not loaded to registry (HKEY_LOCAL_MACHINE\BCD00000000), not in the hivelist (HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\hivelist)

SIMPLE SOLUTION:

open cmd > diskpart > select the efi-partition (fat32, in my case 360 mb)

set id=c12a7328-f81f-11d2-ba4b-00a0c93ec93b (efi start partition), exit diskpart

after this, windows recognizes the efi start partition and loads BCD to registry, the BCD appears in the hivelist, bcdedit /enum works, hibernation works

similar solution under linux:

https://www.tenforums.com/general-support/187123-bcdedit-command-not-working-since-i-rebuilt-bcd.html

change partition flag with gparted from msftdata to boot, esp

thilo
  • 1
  • 2
  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 09 '22 at 16:25
-2

A Does Windows store actual BCD somewhere else? How does windows know on which partition and path to look for system BCD store?

EFI mode works with two legs;

1- a special BIOS (on chip writable area) partition where OS Loader Partition GUIDs are saved.
2- a system (hidden) partition with that GUID named EFI where Bootloader executable located (.efi extension files).

If you have installed/reinstalled several OS'es on EFI mode , then chances are, BIOS SPI chip got cluttered with many records of old OS'es and eventually filled up space on that special 8MB (if I'm not wrong) on-chip partition and became read-only.

Microsoft has a Technet page where it's shown how to clean up EFI duplicate or unneeded guid records (for example OS deleted but EFI record is still there) .
It involves creating a backup of current configuration then resetting it without duplicate records.

on an elevated cmd prompt;

Bcdedit /export savebcd

this will backup current bootloader configurations.
make a copy of it for recovery purposes (savebcd will be our backup);

Copy savebcd newbcd

Then export current records to a text file in human-readable format;

Bcdedit /enum firmware > enumfw.txt

notepad enumfw.txt

Load that file with notepad and review it to point duplicate records.

to delete each duplicate/obsolete record:

Bcdedit /store newbcd /delete {93cee840-f524-11db-af62-aa767141e6b3}

where 93cee840-f524-11db-af62-aa767141e6b3 is just an EXAMPLE guid
replace it with the guid which you think unneeded

once you have gone thru deletion of all unneeded guids;

Bcdedit /import newbcd /clean

Clears current EFI records and imports the cleaned (file we just cleaned unneeded records from) configuration data.
If you still get "A device attached to the system is not functioning." error,
Then; I don't want to be a bad news bringer but You have two paths to follow;
- Stick to your current system; make a WHOLE disk image backup (including your EFI partition) ASAP, because most possibly your SPI (BIOS) chip has cluttered and you cannot flush it without reflashing/replacing it.
This means current Bootloader pointers on the chip are final and if you try to reinstall another OS in EFI mode , it simply won't finalize installation and installer will be interrupted with an error (Windows OS family) or will finalize but BIOS won't load it (Linux installers , e.g. openSUSE), moreover you'll lose your old config, you'll end up having no booting OS on your device.
- Considering you have a Mac , ask tech support to reflash/replace BIOS.
if that's not the case or not feasible; replace hard drive switch to legacy BIOS mode (if that switch in BIOS still works, for me it just didn't work (Lenovo Ideapad B50)

other than these there are some other options to be ruled out as follows: as they are offered as if they are safe tips in some videos on Youtube about this subject, so I just mention them as not to try, because they are dangerous and/or voids device warranty (removing laptop battery + disassembling device to expose motherboard then removing bios battery + waiting (hoping) bios to reset , or shorting (short-circuiting) SPI chip); especially bios battery removal method never works in most (if not all) laptops, while shorting SPI chip can cause even whole system to get bricked.

Hope these helped.

Vishukani
  • 32
  • 3
  • "there are some other options to be ruled out " - So what are these other options? Be specific. Try to keep commentary to a minimum. It is an unnecessary distraction. – Ramhound Oct 21 '17 at 11:10
  • `Bcdedit /export savebcd` this already doesn't work, as are any other commands that read current system BCD store. It looks like bcdedit searches for BCD in the wrong place, because it opens when referenced directly. – Poma Oct 21 '17 at 11:32
  • And what exactly is stored on a special BIOS partition? Because you are saying that it could become cluttered but then proceed describing how to clean up entries in BCD file that is stored on HDD on EFI partition. – Poma Oct 21 '17 at 11:45
  • @Poma - The only thing I know that is stored on a chip related to UEFI is Secure Boot keys. Which of course is an optional feature of Windows and is not applicable to the problem you describe. Apple is known to keep tighter controls on their hardware, so Apple hardware, which keeps tighter controls over their EFI configuration on their hardware. – Ramhound Oct 21 '17 at 11:51
  • as I've told, its a two legged system, one are pointers , others are loaders, pointer entries are written on-chip (not on harddisk) FAT32 partition which is part of BIOS (not exactly BIOS but it's easier to describe) , second part which are loaders are located on a EFI partition, bcdedit cleaning involves cleaning duplicate/obsolete pointer entries from BIOS. – Vishukani Oct 21 '17 at 11:51
  • @Vishukani so what you are saying is that bcdedit command edits and stores data in BIOS and not in `\EFI\Microsoft\Boot\BCD` file? – Poma Oct 21 '17 at 12:05
  • no, I've never told that, if you have read my answer carefully you'll get it; \EFI < this is MOUNT path of EFI Drive where BOOTLOADER FILES reside, NOT BOOTLOADER POINTER ENTRIES reside (it's in on-chip UEFI partition with BIOS) , It's a two step process. – Vishukani Oct 21 '17 at 12:14
  • I'm trying but it still doesn't add up. If bcdedit doesn't edit data in BIOS than how come that bcdedit can be used to free up space in BIOS as you described above? And what exactly is a bootloader pointer entry then? – Poma Oct 21 '17 at 12:24
  • @Poma - there's a list of workers on your desk, writes BILL- 555-10-55, writes STEVE-555-20-50, so anytime you need to reach them you have their phones in your list, this is bootloaders list in your BIOS , you want to call BILL (WINDOWS) , it calls 555-10-55 (this is mount point of your bootloader which is in a hidden partition named EFI and bootloader of Windows located at EFI\Microsoft\Boot\) so this data is on Hard drive, but addresses (phone numbers) are registered on BIOS, but eventually you get so much workers hired and fired, your list becomes cluttered, so you need to clean your list. – Vishukani Oct 21 '17 at 12:35
  • There is still contradiction here. So you don't deny that `bcdedit` edits and stores data in `\EFI\Microsoft\Boot\BCD` file on EFI partition. Then how clearing entries in a file on EFI partition would help with clearing space in BIOS? – Poma Oct 21 '17 at 12:59
  • @Poma - You do understand, Vishukani is trolling, at this point right? – Ramhound Oct 21 '17 at 13:02
  • Looks like I've got what you are trying to say from technet article. So apparently on some systems bcdedit does 2 way synchronization between entries in BCD file on EFI partition and entries in BIOS, so cleaning them in EFI will also clear up space in BIOS. Is this correct? If this is the case this doesn't explain my problem - why bcdedit can't enum records in system store – Poma Oct 21 '17 at 13:17