Saturday, July 28, 2012

Can't Boot Windows 7 After Clonezilla Re-image

After re-imaging a Dell laptop with Clonezilla I could not get it to boot.  I have used the same Win7 image on many systems so I knew it was good.   The first thing I did was boot to a Windows 7 rescue disk and let it try to auto fix the problem which ended up making it worse.  I should have checked the BIOS setting and active partition first as described next and then I think Windows would have rebooted no problem.  But when I ran the auto fix it rewrote the BCD file based on bogus info and broke it.

 Here are the steps I used to troubleshoot and fix:

 Verified the SATA settings in the BIOS, turned out it  was set to RAID and should have been AHCI.  After the BIOS fix I still could not boot so I ran the  Win7 Rescue disk auto-repair again which failed.  From there I called up the repair console command window. First thing I checked was whether the boot partition was active with diskpart At the prompt type diskpart and enter then you will be in a diskpart console with a '>' prompt 

>list disk
Tells you what disks and their id number starting at disk 0

 >select disk 0
Selects your target disk

 >list partition
Tells you what partitions are on the drive in my case 2.  I had a larger system partition which was partition 1 and a very small boot (BCD) partition which was partition 2.

 >select partition 2
Selects your target partition

 >detail partition
Gives details about the partition including whether it is hidden or active.  In my case the partition was visible but not active.  I needed to set it to active

 >active
 This is what you type to set the partition active

 >exit quit or whatever

 At this point a reboot and now Windows 7 tried to boot and failed so I went into recovery mode.  I let it try to auto fix the system but it failed so back to the command line.

Aat the command line I tried these steps:
BOOTREC /FIXMBR                   result good
BOOTREC /FIXBOOT                result good
BOOTREC /SCANOS                  bad total identified windows installations 0
BOOTREC /REBUILDBCD        bad total identified windows installations 0

 This did not work so I decided to look at the boot configuration using bcdedit

at the command line type bcdedit and enter

Results something like this:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Windows\system32>bcdedit

Windows Boot Manager
--------------------
identifier           {bootmgr}
device              partition=\Device\HarddiskVolume2
description       Windows Boot Manager
locale               en-US
inherit              {globalsettings}
default              {current}
resumeobject         {0542b908-aad8-11e1-a78f-ce537be42191}
displayorder         {current}
toolsdisplayorder    {memdiag}
timeout              30

Windows Boot Loader
-------------------
identifier           {current}
device              partition=D:
path                 \Windows\system32\winload.exe
description       Windows 7
locale               en-US
inherit              {bootloadersettings}
recoverysequence     {0542b90a-aad8-11e1-a78f-ce537be42191}
recoveryenabled      Yes
osdevice             partition=C:
systemroot           \Windows
resumeobject         {0542b908-aad8-11e1-a78f-ce537be42191}
nx                   OptIn



In my case I found that the Windows boot loader was pointing to d: not c:.  I knew it should be c: so I used bcdedit to fix.

Bcdedit /set {Default} device partition=C:

Once done I rebooted successfully to Win7
Done

No comments:

Post a Comment