I had this problem, and none of the fixboot/fixmbr/bootrec commands helped. Here's what did fix it:
It appears that the C: is mismapped for whatever reason. In my case, I guess it's because my migration software didn't find it.
Boot into the recovery console and launch regedit.
For those not used to this language, that means:
- Boot from the Win7 disk
- At the "Install Windows" screen press SHIFT F10 to get a command window
- Type "regedit" (without the "")
- and press Enter
Select the HKLM hive and then use "load hive" to mount your c:\windows\system32\config\system hive (I name it 'offline'). You have to select HKLM so that Load Hive will be enabled, we're not actually going to load the offline hive into it.
For those not used to this language, that means:
- Click to Select HKEY_LOCAL_MACHINE
- Click File, Load Hive
- Click the drop down arrow in "Look in"
- Browse to C:\Windows\System32\config
- Select SYSTEM and click Open
- In Key Name type "offline"
- OK
Now you're going to compare HKLM\System\MountedDevices (which is the recovery environment's device list) to HKLM\System\Offline\MountedDevices (which is the one for your failing windows install). In my case, I found that the recovery environment was correctly seeing C:, but the offline hive had the wrong disk signature for c:. (possibly because I deleted a recovery partition as part of the migration. So we need to put the right signature.
Look at the binary entry for DosDevices\C: in the recovery registry. Now go to the offline registry and fix your DosDevices\C: so it matches. In my case, I found it easiest to rename the bad DosDevices\C: to Z:, and then go through the \volume{guid} entries until I found the one that matches the working C:, and then rename that one to DosDevices\C:.
Unload the hive in the file menu, and then reboot. After I did that, I was able to boot.
For those not used to this language, that means:
- Select "offline" in the left hand pane
- Click File, Unload Hive
- Yes
- Close Registry Editor and the Command Window
- Close the "Install Windows" screen
- Yes
- Remove the Win7 disk and boot into Win7.
Other internet searches implied that simply deleting all the offline DosDevices entries would force them to get correctly recreated, but that didn't work for me.
For anybody else that experiences the same problem (completely shot my windows boot partition while installing Linux) and stumbles across this question, I suggest giving the troubleshooting steps from Dell a try. Instructions are for UEFI and GPT only I think.
The command that finally fixed my problem was:
bcdboot c:\Windows /s <boot letter>: /f ALL
For different systems, different variations of the command parameters might be appropriate.
Best Answer
There is no rocket science behind Windows booting. Windows Vista and later boot sequence on MBR disks:
Boot Configuration Data (BCD) for Vista and later is stored in a file "\Boot\BCD" on active partition.
When you move partitions which are critical for booting Vista (Win7, Win8) the data stored in BCD is out of sync with real partition address (disk id + partition offset) so boot fails.
To correct problem with BCD the utility bcdboot.exe can be used:
bcdboot c:\windows
where c:\windows is the root of the OS (Vista, Win7, Win8) which fails to boot, change drive letter if necessary to reflect drive mapping on your system.
To correct boot sector code the command -
bootsect /nt60 all /mbr
can be used.
The commands above are available in WindowsPE and WindowsRE and usually don't fail.
It is possible that some system critical files are also loaded relative to partition address so autochk.exe "\windows\system32\autochk.exe" cannot be found when you move partition start.
The address of a mapped partition is stored in Windows registry (HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices\DosDevices\C: for example)