Google

result

Cheeky Quotes

Wednesday, September 12, 2012

How to Create a Clean BCD file to fix Windows 7 Boot problem

So your Windows 7 PC System no longer boots and you are getting the "...An error occurred while attempting to read the boot configuration data." system error. You have reached the point that all suggestions on startup repair have failed and you may now have to re-create a clean boot configuration data (BCD) file. The following information on creating a clean, fresh BCD file maybe helpful to you.

We are going to use a system command called BCDedit to re-create the BCD file.

Introduction
BCDedit is a really powerful tool that Windows 7 and Windows Vista uses to manage the boot loader entries.

BCDEDIT needs a boot loader file to boot your system.

A boot loader is a file that contains necessary information that instruct the system how to boot/start an operating system.
• Windows 7 and Vista bootloader file is \bootmgr
• Windows XP bootloader file is \ntldr

Bcdedit edits a file called BCD, which is located in Windows 7's hidden partition under C:\boot\BCD.

NOTE: Before performing any changes to your system, please make sure you have a backup of system and personal data files. A backup is essential if things go wrong, when you are making changes to your system.

How to Create a Clean BCD file:
Put your Windows 7 DVD in the drive and restart your PC. Assuming you've properly configured your BIOS to boot from CDs/DVDs before hard drives, you should get a prompt asking you to "Press any key to boot from the CD/DVD..."
Go ahead and press any key.
In the next window, select "Repair your computer" to continue.
On the next window, choose the Windows 7 installation that you'd like to perform the repair on.
Click the Next button.
Proceed with the process by choosing "Command Prompt" from this list [Image below]. We could select the "Startup Repair" to fix the boot problem, but we are assuming that you already tried this option and it did not work.
In the Command Prompt window we shall perform a number of commands to create the new BCD file.



Note: We're assuming that the boot drive is drive C: below. If your computer is configured differently, be sure to use the appropriate drive letter here instead. Each command shown below is separated by a newline for display purposes only. So, command and its switches must be on the same line.

Enter the following commands:

bootrec.exe /fixmbr
X:\boot\bootsect.exe /nt60 all /force


Replace X in the command line above with the device letter to the CD/DVD drive that is running your Windows 7 Recovery Disk.

Now remove the old BCD registry, and create a new one instead.

del C:\boot\bcd

bcdedit /createstore c:\boot\bcd.tmp

bcdedit.exe /store c:\boot\bcd.tmp /create {bootmgr} /d "Windows Boot Manager"

bcdedit.exe /import c:\boot\bcd.tmp

bcdedit.exe /set {bootmgr} device partition=C:

bcdedit.exe /timeout 12

del c:\boot\bcd.tmp


Now we have a clean, working Win 7 bootloader. But we need to add a Win 7 entry to it:

bcdedit.exe /create /d "Windows 7" /application osloader

bcdedit.exe should return a message with a GUID for the newly-created entry. It will look something like this:

The entry {fc8bcc18-8a93-11df-baf9-806e6f6e6963} was successfully created.

You'll need to use the value that bcdedit.exe returned for you below, along with the drive letter for the drive that Windows 7 is installed to:

bcdedit.exe /set {fc8bcc18-8a93-11df-baf9-806e6f6e6963} device partition=C:

bcdedit.exe /set {fc8bcc18-8a93-11df-baf9-806e6f6e6963} osdevice partition=C:

bcdedit.exe /set {fc8bcc18-8a93-11df-baf9-806e6f6e6963} path \Windows\system32\winload.exe

bcdedit.exe /set {fc8bcc18-8a93-11df-baf9-806e6f6e6963} systemroot \Windows


And, last of all, tell the Windows 7 bootloader to boot the new entry by default:

bcdedit.exe /displayorder {fc8bcc18-8a93-11df-baf9-806e6f6e6963}

bcdedit.exe /default {fc8bcc18-8a93-11df-baf9-806e6f6e6963}


Now the Windows 7 bootloader has been removed and rebuilt from scratch.

At this point, you have a clean and hopefully a fully-working bootloader with one entry for Windows 7.

Reboot your PC system to get back into Windows 7.

Enjoy!!!

© pcsoftwarehowto.blogspot.com

23 comments:

  1. Wonderful article! I am agree with the writer's point of view.
    Information removal situation is often a headache for the end user.
    To be able to solve this problem, the professionals have developed several computer data retrieval solutions.
    End user should be well aware of possible computer data retrieval tools so that he could deal the information deletion scenario in a very correct way.
    recover deleted pst file

    ReplyDelete
  2. Excellent reference, thanks!

    ReplyDelete
  3. Hi Rajan,

    This article looks very helpful when there is no bcdboot present but I have two questions:-

    1. Does it going to work if I don't execute this line bootrec.exe /fixmbr
    X:\boot\bootsect.exe /nt60 all /force?

    Actually I don't have my Windows Vista DVD as I am out of my home right now. I am accessing bcdedit through my Dell recovery parition.

    2. I don't understand why you have removed the file in step "del c:\boot\bcd.tmp" while we are working to create a new BCD file.

    Apart from very first step of bootrec I have executed all steps but I don't see any new BCD file in my C:/Boot/

    Please help.

    Thanks
    Ankit

    ReplyDelete
  4. Just a heads up to anyone using this method... All brackets need to be "squiggly".

    ReplyDelete
  5. After typing in C:\boot\bootsect.exe /nt60 all /force

    It returned a message saying "The system cannot find the drive specified" ?

    C: is definitely the drive where my bcd file is located.

    What do I do next?

    ReplyDelete
    Replies
    1. bootrec.exe /fixmbr
      X:\boot\bootsect.exe /nt60 all /force

      its not C:
      Here X: is the device letter of the CD/DVD drive that is running your Windows 7 Recovery Disk.

      Delete
  6. bro the bcdedit.exe /set {fc8bcc18-8a93-11df-baf9-806e6f6e6963} path \Windows\system32\winload.exe step not working for me.. help me

    ReplyDelete
  7. Saved my ass...great thanks

    ReplyDelete
  8. My one OS (Windows 2008 R) is installed in C drive that is running good but the previous OS (Windows 7) is shifted automatically in D: after W2K8 installation and failed to boot. How can I resolve this.

    C:\Users\Administrator>bcdedit

    Windows Boot Manager
    --------------------
    identifier {bootmgr}
    device partition=\Device\HarddiskVolume1
    description Windows Boot Manager
    locale en-US
    inherit {globalsettings}
    default {current}
    resumeobject {e6b8e804-d2c0-11e2-880e-e027dc1ef638}
    displayorder {current}
    {55a1f7ac-59d6-11e3-ae11-001ffb16f167}
    toolsdisplayorder {memdiag}
    timeout 10

    Windows Boot Loader
    -------------------
    identifier {current}
    device partition=C:
    path \Windows\system32\winload.exe
    description Windows Server 2008 R2
    locale en-US
    inherit {bootloadersettings}
    recoverysequence {e6b8e806-d2c0-11e2-880e-e027dc1ef638}
    recoveryenabled Yes
    osdevice partition=C:
    systemroot \Windows
    resumeobject {e6b8e804-d2c0-11e2-880e-e027dc1ef638}
    nx OptOut
    hypervisorlaunchtype Auto

    Windows Boot Loader
    -------------------
    identifier {55a1f7ac-59d6-11e3-ae11-001ffb16f167}
    device partition=C:
    path \Windows\system32\winload.exe
    description DebugEntry
    locale en-US
    inherit {bootloadersettings}
    recoverysequence {e6b8e806-d2c0-11e2-880e-e027dc1ef638}
    recoveryenabled Yes
    osdevice partition=C:
    systemroot \Windows
    resumeobject {e6b8e804-d2c0-11e2-880e-e027dc1ef638}
    nx OptOut
    hypervisorlaunchtype Auto

    My one OS is in C drive that is running good but the another OS (Windows 7) is installed in D: and failed to boot. How can I modify this.

    ReplyDelete
  9. Please put a disclaimer at the top of the article, that the steps will only work for BIOS-MBR installations. If Windows was installed using UEFI-GPT, you cannot and must not use bootrec.exe and bootsect.exe! (and also the BCD registry will not be in C:\Boot\BCD but on the EFI partition)

    ReplyDelete
    Replies
    1. Yup! that's true. Thank for for your suggestion.

      Delete
  10. This is a very helpful article. Much appreciated. It has allowed me to mentally join the pieces of the jigsaw that make the overall boot process picture. Thank you.

    ReplyDelete
  11. This article is fantastic!!! My HD crashed so I had a new one installed. I went to reinstall the back up image that I created from Dell and after the install it boots up just fine. After configuring language, country, etc., the pc wants to reboot. Well it didnt reboot. I received a Windows Boot Error message with the code 0xc000000e. What I was told from Dell is that my back up disks are corrupt. That is not a correct answer. My back up disks are fine but what the back up disks dont do is back up the BCD file. So on a fresh install the BCD file is missing 3 lines. They show as "unknown". I was able to configure my BCD file using the info from this article and I have my pc back. Thank You!!!

    ReplyDelete
  12. Our team member are fix all type error and complete solution of your problem. Go through this url.
    Fix Windows 7 Error 1068
    Thank you
    Aalia lyon

    ReplyDelete
  13. Mine came back: file header checksum does not match computer checksum

    ReplyDelete
  14. Thank. You. So. Much.

    Those commands saved my butt.

    ReplyDelete
    Replies
    1. Please note, on first attempt at bootup after I did all the bcdedit commands, the PC had an error. I put the Installation DVD back in, booted from that, and the PC said it found errors. Did I want to repair them automatically? Clicked repair, rebooted, and the PC booted like a champ! Thanks so much for the detailed instructions!

      Delete
  15. Wow! Thanks for this! You helped me to recover a dead computer. Somehow the osdevice and device paratmers were pointing to the wrong partition. I fixed it thanks to the information found here and is working now.

    ReplyDelete
  16. Why create a temporary bcd and import it ? Is there any reason not to create the bcd directly and work on it ?

    ReplyDelete
  17. I read this article attentively. Thanks to post this kind of informational article. Windows users can also repair windows error by reading this blog post.

    ReplyDelete
  18. This comment has been removed by the author.

    ReplyDelete