Disclaimer: You will need administrative privileges to run these commands. In addition you will need to open up a command prompt with those rights to make the changes. Last but not least we will be working with the entries regarding the boot loader. If the entries get fouled up for some reason and your computer no longer boots then I am not responsible. You have been warned.
Update: The following instructions were updated on 5/7/2010 because some of the directions were wrong. I found on my last cloning job that the entry that maps the recovery entry and the options for that entry are different by one character. Usually incremented up one it is the 8th character in most cases. I show it below in the examples but the actual command string examples fail to show that and I don’t indicate it in the base command lines. I have corrected that below.
After a drive clone (and possibly in other scenarios) you may end up being unable to boot the “Repair Your Computer” option. It may give you an error that it failed to locate the specified partition or device. Here is what you need to fix the issue. Just to show you what I am referring to I will give you a screen capture of the result when you try and use that option after a clone. The issue was replicated under a 2 drive scenario using vmware. One was a 40GB and the other was an 80GB.
Before we get started we need to open an adminstrator command prompt. If you don’t know how to do it then you can do it by clicking on Start and at the bottom type in ‘cmd’ and you can either do Ctrl+Shift+Enter or you can right-click on the cmd entry that now appeared and choose ‘Run as Administrator’. This will remain true for any of the following instructions. You may open a new one as needed.
First you need to list all entries (and I mean all of them) from bcdedit:
bcdedit /enum all
Next you need to find the identifier to the installation that is affected. For each entry in bcdedit they have their own repair options. Look for the one that has the description of your boot entry. As an example here is mine.
Windows Boot Loader
-------------------
identifier {current}
device partition=C:
path \Windows\system32\winload.exe
description Windows 7
locale en-US
inherit {bootloadersettings}
recoverysequence {9989caf8-c72d-11de-998a-d8acbaea39b0}
recoveryenabled Yes
osdevice partition=C:
systemroot \Windows
resumeobject {9989caf6-c72d-11de-998a-d8acbaea39b0}
nx OptInNote the recoverysequence line because that is now our enum (enumerator). I will refer to it as <enum> where you need to insert it. Don’t note the braces. Just the letters, numbers, and hyphens. The recoverysequence and resumeobject lines will always match the identifier for the operating system in question. You will also need note the part on the line that says osdevice and what it shows right after the equal sign (=). I will reference it as <drive> where needed. I have bolded the relevant parts. In this instance we will make note of 9989caf8-c72d-11de-998a-d8acbaea39b0 as our recovery enum and C: as the drive itself.
Now then further down (and in fact right below) you should see this. It should have the recovery enum as noted above.
Windows Boot Loader
-------------------
identifier {9989caf8-c72d-11de-998a-d8acbaea39b0}At the very end we should see the next set of lines. You will note the ramdisksdipath line includes the recovery enum.
Device options
--------------
identifier {9989caf9-c72d-11de-998a-d8acbaea39b0}
description Ramdisk Options
ramdisksdidevice unknown
ramdisksdipath \Recovery\9989caf8-c72d-11de-998a-d8acbaea39b0\boot.sdiThe issue on the last one is that it is supposed to be the recovery lines but it is otherwise blank. On the one right above the ramdisksdidevice says it is unknown. Note that this entry contains our options enum which is bolded above. Please keep that for record as we will need it during our instructions. In the above example it is 9989caf9-c72d-11de-998a-d8acbaea39b0. Here is how we are going to fix it.
Run the following commands and this will fix the first set of issues.
bcdedit /set {<recovery enum>} device ramdisk=[<drive>]\Recovery\<recovery enum>\winre.wim,{<options enum>}
bcdedit /set {<recovery enum>} osdevice ramdisk=[<drive>]\Recovery\<recovery enum>\winre.wim,{<options enum>}So in my case I would run the following to try to repair the first part.
bcdedit /set {9989caf8-c72d-11de-998a-d8acbaea39b0} device ramdisk=[C:]\Recovery\9989caf8-c72d-11de-998a-d8acbaea39b0\Winre.wim,{9989caf9-c72d-11de-998a-d8acbaea39b0}
bcdedit /set {9989caf8-c72d-11de-998a-d8acbaea39b0} osdevice ramdisk=[C:]\Recovery\9989caf8-c72d-11de-998a-d8acbaea39b0\Winre.wim,{9989caf9-c72d-11de-998a-d8acbaea39b0}Unfortunately even after running that you will still have the issue. When you try and run them please run them in the order above. If you get an error doublecheck your lines but otherwise you will need to reboot before you can try again. Once you do that though you should be able to find something like the following when you run our original command again. Note that there is a difference in the actual enum strings used for the recovery and option identifiers. It is mentioned earlier how to get those identifiers.
Windows Boot Loader
-------------------
identifier {9989caf8-c72d-11de-998a-d8acbaea39b0}
device ramdisk=[C:]\Recovery\9989caf8-c72d-11de-998a-d8acbaea39b0\Winre.wim,{9989caf9-c72d-11de-998a-d8acbaea39b0}
path \windows\system32\winload.exe
description Windows Recovery Environment
inherit {bootloadersettings}
osdevice ramdisk=[C:]\Recovery\9989caf8-c72d-11de-998a-d8acbaea39b0\Winre.wim,{9989caf9-c72d-11de-998a-d8acbaea39b0}
systemroot \windows
nx OptIn
winpe YesThe rest of the lines (other than the 2 we did) will auto-populate into the list for you. After you confirm it you will need to reboot so the system can reload the BCD store. The next command will not work until that is done.
Once the system is rebooted you can run this command finally. It will fix the second issue.
bcdedit /set {<options enum>} ramdisksdidevice partition=<drive>So for the second part I would run something like the next line.
bcdedit /set {9989caf9-c72d-11de-998a-d8acbaea39b0} ramdisksdidevice partition=C:The last entry now should show something like this now.
Device options
--------------
identifier {9989caf9-c72d-11de-998a-d8acbaea39b0}
description Ramdisk Options
ramdisksdidevice partition=C:
ramdisksdipath \Recovery\9989caf8-c72d-11de-998a-d8acbaea39b0\boot.sdiNow then all you need to do is reboot and it should work fine now.

