Cloning a Windows 10 installation across disk technologies

A while back, I decided it was time to upgrade by desktop system, and bought one of the new Intel NUC's (Skull Canyon.)  To cut back on the initial cost, I've been running off the mSATA drive from my old desktop system via a mSATA->USB 3.0 adapter (with surprisingly good performance.)  I decided it was time to get proper storage, and picked up a Toshiba/OCZ RD400 256 GB NVME m.2 drive (try saying that 5 times fast!)

Since my existing Windows installation was sat up exactly how I liked it, I wanted to clone it to my new drives.  This proved a bit difficult...especially with switching from USB to m.2...and using GPT partitions with UEFI...so I'm going to outline the steps I used in case it helps someone else:

Items you'll need:

  • Original storage device
  • New storage device
  • 2 USB Flash Drives (at least 8 GB each)

 

Before swapping the drives, perform the following steps:

Step 1 - Download drivers!

  1. If your new drive is on a completely different bus from your original drive (i.e. upgrading from SATA to m.2), you MUST download and extract the drivers for the new bus to a folder on your hard drive...otherwise your machine WILL NOT BOOT at the end of this process.  In my case, I downloaded the Toshiba/OCZ NVME drivers and extracted the "x64" folder to C:\nvme

Step 2 - Creating the Clonezilla USB boot drive:

  1. Download Clonezilla Alternate Stable ISO for amd64
  2. While the ISO is downloading, format one of your flash drives for FAT32.
  3. Mount the ISO in Windows by double clicking it, and copy all files directly into the root of the flash drive.
  4. Remove the flash drive.

Step 3 - Creating the Windows 10 USB Installer boot drive:

  1. Plug in your second flash drive.
  2. Download the Windows 10 Media Creation Tool and run it.
  3. Click Create Installation Media for another computer.
  4. Check "Use the recommended options for this PC" and click next.
  5. Click "USB flash drive" and click next.
  6. Select the flash drive from the list, and click Next.
  7. Once the process is complete, shut down the computer.

Step 4 - Clone the drive

  1. Install the new drive in your computer, insert the Clonezilla flash drive, and start your computer.  You may need to change your BIOS options to allow booting from the flash drive.
  2. The Clonezilla boot menu will pop up.  For most systems, just press enter.  In my case, the only option that would successfully boot was "(Default settings, KMS)"
  3. You can press Enter to the language and keyboard prompts.
  4. Select Start Clonezilla and press Enter.
  5. Select Device-Device and press Enter.
  6. When asked what mode you want to run in, select Expert and press Enter.
  7. Select disk_to_Local_disk and press Enter.
  8. The next few screens will have you select the source disk, the target disk, and prompt you with a large list of steps you can choose to do to the drive.  When the large list pops up, uncheck the option to install grub (for a Windows partiton, you don't need it.)
  9. All of the other steps in the wizard, leave it set to the defaults and press Enter, except for the step that asks what you want to do after the clone.  On this step, select "Power Off" and press Enter.
  10. Once everything is configured, Clonezilla will ask you twice if you're sure you want to clone the drive.  Confirm away, and the clone process will start.  Once the system powers off, proceed to Step 4

Step 5 - Make Windows bootable again

  1. With the machine powered off, remove the original storage device.  THIS IS A MUST!  With GPT-based drives, there is a GUID that identifies which partition Windows should boot from.  Since you cloned the drive, there's now two drives with identical GUID's.
  2. Insert the Windows 10 Installer flash drive and power on the computer.
  3. Once booted into the Installer, select your language and click Next.
  4. Down in the lower left corner, select "Repair my computer."
  5. Click Troubleshoot -> Advanced options -> Command Prompt
  6. Type "diskpart" and press enter.
  7. Type "list disk", press enter, find the number of your new storage device, and type "select disk x" (replacing x with the number of the drive) and press enter.
  8. Type "select partition 1" and press enter (partition 1 is your EFI boot partition.)
  9. Type "assign" and press enter.
  10. Type "exit" and press enter.
  11. If your new storage device is the only drive on your system, type "D:" and press enter.  Then type "dir" and press enter, and you should see an EFI folder.  If not, continue to try other drives above "D:", like "E:", "F:" etc. until you find one with an EFI folder.  Don't use "X:", as that's the flash drive.
  12. Once you find the EFI folder, type "cd EFI\Microsoft\Boot" and press enter.
  13. Now, type "bcdedit /store bcd" and press enter.  Most systems will have 2 sections listed, one for {bootmgr} and one for {default}.  In most cases, you want to modify the {default} section.  We're going to tell the Windows bootloader how to find the correct boot partition.
  14. Type "bcdedit /store bcd /set {default} device partition=C:" and press enter.
  15. Type "bcdedit /store bcd /set {default} osdevice partition=C:" and press enter.
  16. Now that the BCD has been fixed, install the drivers you downloaded in step 1 by typing "dism /image:C:\ /add-driver /driver:C:\nvme" and press enter.  The reason you have to do this is your original hard drive was on a completely different bus, and the driver needed to read from the new drive (and continue the boot process) is missing.  This installs the driver so the boot process can find it.
  17. Type "exit", restart the system, and pull out the flash drive.

If everything goes as planned, you'll be looking at the Windows 10 login screen from your new storage device.  :-)

If you wish to use the old drive for storage, I would recommend either creating a new partition table/formatting the drive from a different PC.  The GUID's are still identical, and may cause your system to either boot from the wrong drive, or cause your new drive to not boot at all.