Bootrec /rebuildbcd gives "Element not found."


  1. Posts : 20
    Windows 10
       #1

    Bootrec /rebuildbcd gives "Element not found."


    Hi folks,

    Long story short, I moved my C:/ partition and now I can't boot into Windows. I get a 0xc000000f error when I try - boot configuration data is missing or contains errors, file: \Boot\BCD - and it is an MBR disk.

    I suspect what I need to do is rebuild the boot configuration to point to the new partition location - and indeed, when I run bootrec /rebuildbcd it successfully identifies my Windows partition. However, when I answer "yes" to the question "Add installation to boot list?" I get the message "Element not found."

    NOTE: I have tried setting the partition to "active" using diskpart, but this does not seem to make a difference.

    Any tips, or should I just scrap it and reinstall from scratch? My data is backed up. Thanks in advance!
    Last edited by jfrench; 10 Mar 2021 at 14:57. Reason: Updated error again
      My Computer


  2. Posts : 5,269
    Windows 11 Pro 64-bit
       #2

    Since the BCD store exists and lists a Windows installation, you'll first have to "remove" it manually and then try to rebuild it again.

    At the Command Prompt, type below command as shown and then press Enter:

    Code:
    C:
    At the Command Prompt, type below command as shown and then press Enter:

    Code:
    bcdedit /export C:\bcdbackup
    The bcdedit command is used here to export the BCD store as a file: bcdbackup. There's no need to specify a file extension.

    The command should return the following on screen:
    The operation completed successfully.

    Meaning the BCD export worked as expected.


    At this point, you need to adjust several file attributes for the BCD store so you can manipulate it. At the prompt, execute the attrib commands exactly like this:

    Code:
    attrib c:\boot\bcd -h -r -s
    What you just did with the attrib command was remove the hidden, read-only, and system attributes from the file bcd. Those attributes restricted the actions you could take on the file. Now that they're gone, you can manipulate the file more freely - specifically, rename it.

    To rename the BCD store, execute the ren command as shown:

    Code:
    ren C:\boot\bcd   bcd.old
    Now that the BCD store is renamed, you should now be able to successfully rebuild it.

    Try rebuilding the BCD again by executing the following, followed by Enter:

    Code:
    bootrec /scanos
    bootrec /rebuildbcd
    Restart your computer after rebuilding the BCD store.
      My Computer


  3. Posts : 20
    Windows 10
    Thread Starter
       #3

    Forgot to mention - I don't quite understand this, but my original Windows setup did not include a system partition. It was just the C:\ partition that contained all my data, and seemed to boot fine.

    Note: I am running a dual-boot system, with Ubuntu installed first. When I power on the computer, grub shows me a screen where I can select Ubuntu or Windows.

    This worked great for 12+ months, until I decided to move the partitions around. Now, selecting Windows gives the error described above.

    - - - Updated - - -

    FreeBooter said:
    Since the BCD store exists and lists a Windows installation, you'll first have to "remove" it manually and then try to rebuild it again.
    I will try these steps, thank you FreeBooter! Will report back.

    - - - Updated - - -

    OK - some errors starting with the 2nd command:
    Code:
    bcdedit /export C:\bcdbackup
    returns

    Code:
    The store export operation has failed.
    The requested system device cannot be found.
    And when I try the third command (attrib c:\boot\bcd ...), it gives "file not found"

    Checking the file structure on the partition, it appears there is a Boot directory, which contains a bunch of language directories like "en-US" which in turn contain bootmgr.exe.mui and memtest.exe.mui files. The Boot directory also contains some .dll and .DAT files, memtest.exe and BCD.LOG files - like BCD.LOG, BCD.LOG1, BCD.LOG2

    No bcd file, but there is bcd.old, which I think is from me following other instructions prior to posting here, which had me enter commands similar to your suggestion (with similar results, as I recall).

    Ideas for next steps? I don't quite understand what's going on...
      My Computer


  4. Posts : 5,269
    Windows 11 Pro 64-bit
       #4

    Type bcdboot C:\Windows /s w: /f ALL and press Enter.


    Please replace partition letter C: with Windows installed partition letter. When computer boots into Windows Recovery Environment (WinRE) environment the drive letter assign to Windows partition may not be C: drive letter because Windows 7, 8 , 8.1 and 10 creates a separate system partition when it's installed from scratch. The system partition contains boot files WinRE assigns the system partition the C: drive letter and the Windows installed partition will be assign any other drive letter usually D: drive letter is assign to Windows installed partition. The Bcdedit /enum | find "osdevice" command can be use to find out the drive letter of the Windows installed partition the output of the Bcdedit command is similar to this osdevice partition=D:. The drive letter after partition= is the drive letter of the Windows partition.
      My Computer


  5. Posts : 1,565
    win10 home
       #5

    As you suggested in post 1,scrap and start again.
    Quick,simple and problem free,in theory.
      My Computer


  6. Posts : 20
    Windows 10
    Thread Starter
       #6

    FreeBooter said:
    Type bcdboot C:\Windows /s w: /f ALL and press Enter.
    "Failure when initializing library system volume."

    And thank you for the clarification about drive letter assignments. I just check with a quick "dir" to see if I'm in the expected partition.

    - - - Updated - - -

    joeandmarg0 said:
    As you suggested in post 1,scrap and start again.
    Quick,simple and problem free,in theory.
    As a last resort, I will do that, but it irks me to be so close with seemingly intact partitions.

    - - - Updated - - -

    I just realized the w: in the previous command should be x: since "vol x:" returns "Volume in drive X is Boot" while w: cannot be found.

    Now I get the following:
    Code:
    bcdboot C:\Windows /s x: /f ALL
    BFSVC Error: Failed to set element application device. Status = c00000bb
    BFSVC Error: Failed to populate BCD store. Status = c00000bb
    - - - Updated - - -

    Edit: now I'm not sure that I understand anything, but the below is what I've tried & originally wrote:

    Hmmm, careful reading of the bcdboot manual leads me to believe that the correct command should be:

    bcdboot X:\Windows /s C: /f ALL

    aka the source and destination were reversed. /s flag tells the command where to copy the files TO - not from. (I'm assuming that X: is my Windows 10 USB which I'm using to run recovery - am I wrong?)

    Trying this still gives the same errors & does not solve my issue, but the error has changed now when trying to boot Windows - it's 0xc0000034 - missing some required information from \Boot\BCD

    Thank you all for your help thus far! I am out of ideas. My next step is to take a nap & will likely give up and install from scratch once I'm rested. Open to any brilliant last minute advice though...!
    Last edited by jfrench; 10 Mar 2021 at 17:17.
      My Computer


  7. Posts : 514
    Windows 10
       #7

    Lazesoft has all the means of sorting this out, very quickly.

    Lazesoft Windows Recovery Home
    Download Lazesoft Windows Recovery Home 4.5.0.1
    https://i.imgur.com/p7x9FdG.png
    Download Lazesoft Products
    Disk Partition Recovery
    Lazesoft Data Recovery - How to recover data from a formatted or damaged partition

    Or,

    How to use a Lazesoft Windows Recovery CD or USB device to fix the boot problems if your Windows operating system does not start correctly.
    "It is very common for PC users to be faced with a Windows crash. When this happens, the dreaded 'Blue Screen of Death' pops up, or your PC has a black screen and can not boot or start up"

    Lazesoft Recovery Suite Home
    Download Lazesoft Recovery Suite Home 4.3.1
    Lazesoft Recovery Suite Free, Free Windows System Recovery, Free Data Recovery, Free Windows Password Recovery, Free Disk Clone
    Screenshot ( SS )
    https://i.imgur.com/c9viJO4.gif
    https://i.imgur.com/LaEidXn.gif
    Tutorials
    Tutorials - Lazesoft Recovery Suite Software
    How to Boot a Computer from a Lazesoft Recovery USB Device
    How to Boot a Computer from a Lazesoft Recovery USB Device
    How to Burn a Lazesoft Recovery CD
    http://www.lazesoft.com/burn-a-boota...covery-cd.html
    Last edited by jmatt; 10 Mar 2021 at 21:20.
      My Computer


  8. Posts : 5,269
    Windows 11 Pro 64-bit
       #8

    You will have to use Diskpart command to find out the System Reserved partition drive letter.
    The output of the below commands may display the name of the System Reserved partition as only System or ESP.

    Type diskpart and press Enter.
    Type list volume and press Enter.
    Under the label row, find the label System Reserved and note its corresponding Volume number.
    Now type select Volume=N and press Enter, where N is the Volume number you noted earlier.
    Now type assign letter=w and press Enter.
    Type exit and press Enter.
    Type bcdboot C:\Windows /s w: /f ALL and press Enter.


    Please replace partition letter C: with Windows installed partition letter. When computer boots into Windows Recovery Environment (WinRE) environment the drive letter assign to Windows partition may not be C: drive letter because Windows 7, 8 , 8.1 and 10 creates a separate system partition when it's installed from scratch. The system partition contains boot files WinRE assigns the system partition the C: drive letter and the Windows installed partition will be assign any other drive letter usually D: drive letter is assign to Windows installed partition. The Bcdedit /enum | find "osdevice" command can be use to find out the drive letter of the Windows installed partition the output of the Bcdedit command is similar to this osdevice partition=D:. The drive letter after partition= is the drive letter of the Windows partition.
      My Computer


  9. Posts : 20
    Windows 10
    Thread Starter
       #9

    Thanks, but as I mentioned in my second post, this filesystem did not have a System Reserved partition. I gave up, backed my files up to an external drive using Ubuntu, then used Gparted to delete all partitions & give the drive a GPT partition table so Win10 install media would do UEFI install.

    Currently copying files back onto the clean system. My takeaway? Thank goodness for Linux!!!

    Thanks all for your valiant efforts!
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 03:33.
Find Us




Windows 10 Forums