bcdedit.exe refuses to open system store

9,537

Solution 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.

Solution 2

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.

Share:
9,537

Related videos on Youtube

Poma
Author by

Poma

Updated on September 18, 2022

Comments

  • Poma
    Poma almost 2 years

    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

    • Ramhound
      Ramhound over 6 years
      “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?
    • Poma
      Poma over 6 years
      And the full path is always EFI\Microsoft\Boot\BCD?
    • Ramhound
      Ramhound over 6 years
      The EFI partition shouldn’t have a drive letter. The answer to your question is that for UEFI systems it is indeed: technet.microsoft.com/en-us/library/cc721886(v=ws.10).aspx
    • Poma
      Poma over 6 years
      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?
  • Ramhound
    Ramhound over 6 years
    "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.
  • Poma
    Poma over 6 years
    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
    Poma over 6 years
    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.
  • Ramhound
    Ramhound over 6 years
    @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.
  • Vishukani
    Vishukani over 6 years
    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.
  • Poma
    Poma over 6 years
    @Vishukani so what you are saying is that bcdedit command edits and stores data in BIOS and not in \EFI\Microsoft\Boot\BCD file?
  • Vishukani
    Vishukani over 6 years
    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.
  • Poma
    Poma over 6 years
    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?
  • Vishukani
    Vishukani over 6 years
    @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.
  • Poma
    Poma over 6 years
    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?
  • Ramhound
    Ramhound over 6 years
    @Poma - You do understand, Vishukani is trolling, at this point right?
  • Poma
    Poma over 6 years
    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
  • JinSnow
    JinSnow almost 4 years
    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)
  • Harry Johnston
    Harry Johnston almost 4 years
    @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"?
  • JinSnow
    JinSnow almost 4 years
    thanks for your reply. It seems to be faulty hard drive (I'm installing windows on another drive to check this hypothesis)
  • JinSnow
    JinSnow almost 4 years
    thanks for your reply. It was probably a faulty hard drive (details: superuser.com/a/1584467/235752 )
  • Admin
    Admin about 2 years
    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.