Archive for May, 2013

Clone Win7 to SSD and fix boot with BCDedit

May 18, 2013

Existing setup: dual boot Win7 / Ubuntu on old 64GB SSD drive (dev/sda1 and dev/sda2). Out of space. Want to move Win7 to its own 128GB SSD and delete the old win7 from the 64GB SSD, so that becomes the dedicated ubuntu drive.

The new 128GB SSD is installed as dev/sdc1.

Boot into Ubuntu normally. Run GParted, format the new SSD to NTFS, allow 1MB before the partition for correct sector alignment (select MiB, not Cylinders).

Download Clonezilla Live CD, add it to your bootable USB using Multisystem USB creator. Reboot into the live USB. Follow directions for Clonezilla partition to partition. Took about 5 minutes to complete.

Boot back into ubuntu, open a terminal, run “sudo update-grub” and it will find the new win7 (on /dev/sdc1) install and place it alongside the prior win7 (on /dev/sda1) ┬áin the grub bootloader selector. Note that I still have both drives connected in the case.

When reboot, I choose the Win7 on /dev/sdc1 (the new one), and it magically boots with no problems! But it’s too good to be true… it’s actually booted into the old Win7. It turns out that the bootloader in the cloned win7 is still pointing at the original device.

Note, on this computer
/dev/sda1 in ubuntu is actually the C: drive in Windows.
/dev/sdc1 in ubuntu is actually the E: drive in Windows.

Old win7 on /dev/sda1 is booting device=C:
New win7 on /dev/sdc1 is also booting device=C: (but the new win7 is on E:).

We need to use bcdedit to change C: to E: in the new win7 clone.

So… boot into the original Win7, run the cmd terminal as Administrator.

List the bootloader setup on the C: drive
“bcdedit /store C:\boot\BCD /enum”



List the bootloader setup on the E: drive looks exactly the same.
“bcdedit /store E:\boot\BCD /enum”

How to edit:

“bcdedit /store E:\boot\BCD /set {bootmgr} device partition=E:”
“bcdedit /store E:\boot\BCD /set {default} device partition=E:”
“bcdedit /store E:\boot\BCD /set {default} osdevice partition=E:”

“bcdedit /store E:\boot\BCD /enum”



Reboot, select the new Win7 on /dev/sdc1 during grub menu.