How to repair the boot sector or boot configuration database (BCD) of a system that has been imaged but wont boot

Problem

Occasional problems with imaging tools and processes could lead to a system that will not boot after it has been reimaged. For example, differences in SATA controller, partition sizes or versions of imaging software could leave you with a system where the boot sector is not correct, or the boot configuration database (BCD) needs to be re-written.

Typically systems with this problem will not boot the operating system but just display a flashing cursor on the screen after the BIOS POST has completed.

Note: These instructions have been written for Windows 7 and do not apply to Windows XP.

Instructions

Stage 1 - Boot from the Recovery CD
1. Create a Windows 7 Recovery CD that matches the imaged operating system (for example 32 bit or 64 bit).
2. Boot the system from the CD.
3. Ensure you press a key when prompted to confirm that you want to boot the system from the CD.

Tip: If you cannot create a Windows 7 Recovery CD, then a bootable USB pen drive containing Windows PE will suffice.

Stage 2 - Set the Active Partition
4. When the system has finished booting from the CD, select the Command prompt option from the menu.
5. At the command prompt type DISKPART and then press enter. You will get the DISKPART> prompt.
6. Type the following instructions in red precisely:
7. DISKPART>select disk 0 and press enter.
8. DISKPART>list partition and press enter.
9. DISKPART>select partition 0 (this should be the partition that the system boots from, normally the small reserved area) and press enter.
10. DISKPART>active and press enter.
11. DISKPART>exit and press enter.
12. You are then returned to the X:\ prompt

Stage 3 - Fix the Master Boot Record, Boot sector and Boot Configuration Database (BCD)
13. From the Recovery Command Prompt (normally X:\>) select the C drive - i.e. type C:
14. Change to the Boot Directory i.e. cd\boot and then press enter
15. Type in bootrec /FixMbr and press enter.
16. Then type bootrec /FixBoot and press enter.
17. Finally, type bootrec /RebuildBCD and press enter.
18. After rebuild has finished reboot the machine.
19. The machine should now boot into windows 7.

Further Information

You may be able to prevent this situatiuon when deploying an Operating System image by using an option in your disk imaging software to completely recreate the partition table and boot sector (effectively erasing the drive), for example by using the DISKPART CLEAN ALL command. Note that this may remove Virtual PC check or other pre-installed tools.

Applies to:



Article ID: 36
Last updated: 06 Nov, 2015
Revision: 10
Stone Branded Products -> Desktop PCs and All-in-One (AIO) -> Troubleshooting -> How to repair the boot sector or boot configuration database (BCD) of a system that has been imaged but wont boot
https://kb.stonegroup.co.uk/index.php?View=entry&EntryID=36