How To: Clone Windows 10 from SATA SSD to M.2 SSD (& fix inaccessible boot device)

1TB WD Black SN750 NVMe M.2 SSDA few weeks ago I received a 1TB Western Digital Black SN750 M.2 SSD, boasting an impressive 3470 MB/s read speed on the packaging. I already had a SATA SSD installed in my gaming/photo editing PC. Nevertheless, those specs got me to pick up a screwdriver and install the new M.2 SSD. The physical installation is dead simple: remove graphics card, install M.2 SSD, reinstall graphics card. I wasn’t really looking forward to a full reinstallation of Windows 10 though. There’s just too many applications, settings and licenses on that system that I didn’t want to recreate or re-enter. Instead, I wanted to clone Windows 10 from SATA SSD to M.2 SSD.

After a little bit of research, I ended up with Macrium Reflect, which is freeware disk cloning software. Long story short: I cloned the old SSD to the M.2 SSD, rebooted from the M.2 SSD, and… was greeted with a variety of errors. The main recurring error was Inaccessible Boot Device, however in my troubleshooting attempts I saw many more errors.

UEFI vs BIOS

GPT partition style

While googling for solutions, many solutions mentioned the bootrec.exe, bcdedit.exe and diskpart commands to solve the boot issues. In the end however, my problem had more to do with the difference between BIOS and UEFI, and how storage devices are addressed. I’m still not 100% sure why, so feel free to comment below!

I was running a really old BIOS, and never properly set it up when I initially installed Windows 10 many years ago. In that old BIOS, my storage devices were set to Legacy mode instead of UEFI. This is probably because it ran Windows 7 or 8 a few years ago; or just because I never changed it from the default mode. What this in effect means is that my old SATA SSD was formatted with MBR instead of GPT (it’s a partitioning scheme). It also means that my Windows 10 installation had a “system partition” instead of an “EFI system partition”. There is a important distinction here.

All this meant I could clone and play around with bootrec and bcdedit all day long, but it wasn’t going to solve my problem. I kept getting Inaccessible Boot Device errors, the bootrec and bcdedit commands didn’t find my Windows installation, and changing drive letters with diskpart didn’t do anything either. So what did enable me to clone clone Windows 10 from SATA SSD to M.2 SSD? I had to upgrade to a UEFI Windows 10 installation, with a GPT partition style! Fortunately, that’s not as hard as it sounds.

Preparations: backup and unplug other drives

First of all, the mandatory disclaimer. Commands in this post have the potential to ruin your installation. If there’s anything important on your drives, make a backup. I’m not to blame if you lose data.

Next up, unplug other drives. I have a 6TB WD Red drive in there as well, so I unplugged that to make sure I wasn’t going to accidentally format it. Leave the PC cover off, because you might be unplugging and connecting drives a few times.

It also helps if you have another system/laptop and a few 4-8GB USB sticks nearby, so you can create a few tools that will help along the way. I created a Windows 10 Recovery Drive and (on advice of a dear friend), created a CloneZilla USB stick.

A quick check to see if this post applies to your situation is to open disk manager (right-click the Windows “start” button, choose disk management). Locate your old SATA SSD drive, right click the drive and choose properties. Navigate to the volumes tab. In the Partition style field, you should see Master Boot Record (MBR). If you already see GUID Partition Table (GPT), this fix might not apply to you. Do continue reading if your curious though… ūüėČ

Convert from MBR to GPT

A UEFI system will only boot from a GPT drive. So I had to convert my existing SATA SSD that housed my Windows 10 installation from MBR to GPT. Fortunately, with Windows 10 Creators Edition, that’s fairly simple. Open up the Windows Settings, go to Updates & Settings, select Recovery. Find Advanced startup, and restart your system. This will cause your Windows 10 system to reboot into the advanced startup mode, which (among other options) gives you a command prompt.

Reboot to WinPE

Once rebooted, navigate through the options until you get a command prompt. In there, run diskpart to verify the correct drive number:

diskpart MBR vs GPT

In this screenshot, you can see that Disk 0 is my old 500GB SATA SSD and Disk 1 is my new 1TB NVMe M.2 SSD. The old SSD is not GPT partitioned, the new SSD is indeed GPT style (because I played around with it during troubleshooting).

So we need to convert disk 0. Exit diskpart, and run the following command: mbr2gpt /validate

 mbr2gpt validate

Check two things: that the command is pointing to the right drive, and that the validation completes successfully. If it doesn’t point to the right disk immediately, you can adjust the command to mbr2gpt /validate¬†/disk:0¬†to force it to run on disk 0. Of course, substitute the disk number for your own configuration.

If this all works, convert the drive with mbr2gpt /convert (or mbr2gpt /convert /disk:0):

mbr2gpt convert and verify afterwards

Check for errors (hopefully, none). What this mbr2gpt does (Microsoft KB article) is:

  • Change the partitioning style to GPT
  • Create a new EFI system partition
  • Create new boot files in this new EFI system partition. This is the key thing that will ultimately allow you to boot from the M.2 drive and avoid the boot device inaccessible error!

Afterwards, run diskpart again to verify the partition style has indeed changed to GPT. Mine has, so we are ready to continue. Exit out of the command line interface and power down your system. Do not just reboot, because we need to switch to UEFI mode.

Change Legacy BIOS mode to UEFI

Power the system back on again and enter the BIOS. Each BIOS is different, so check your manual for your specific procedure. In my Gigabyte BIOS, it looks like this:

Legacy BIOS vs UEFI

The left is MBR, the right is UEFI. I could have left CSM Support enabled and manually toggled the boot device to UEFI, but Windows 10 doesn’t require CSM Support so I disabled it entirely.

Save your settings and exit the BIOS. You should now cleanly boot into your old Windows 10 installation from your old SATA SSD. Verify all your files are still there, maybe even reboot a second time to verify everything is working as intended. Once you’re happy you haven’t broken anything, it’s time to FINALLY clone Windows 10 from SATA SSD to M.2 SSD!

Cloning your SATA SSD to the M.2 SSD

To clone the old SATA SSD to the M.2 SSD, you can use a multitude of tools. Macrium Reflex and Clonezilla are both freeware; Macrium has a nice GUI, Clonezilla is a little bit more oldskool. On my final clone I used clonezilla. Mostly because it’s a bit faster, but also because my Windows 10 install is completely shut down during the clone. Pick whichever you like.

Once the clone is completed, power down your system. You want to unplug your old SATA SSD, as having two boot disks with identical Windows installations could have pretty spectacular results. And not in a positive sense!

Inaccessible boot device

Once the SATA SSD is unplugged, power the system back on again. If needed, change the BIOS settings to boot from the NVMe M.2 SSD. If you are lucky, that installation might boot straight away. In my case, I was back to the dreaded Inaccessible Boot Device blue screen of death (BSOD). Let the PC loop through this blue screen routine for three times, after which it will automatically boot into the Advanced Startup settings to help you fix things. Navigate to the Command Line Prompt again; all the other troubleshooting options didn’t do much in my case.

Even though the MBR2GPT command already recreated the boot files, they will need to be changed again due to the disk clone. What we are going to do now is recreate the boot files manually with the bcdboot command. First, run the diskpart command again to verify drive letters:

Windows and EFI system volumes

In my case, C is the Windows 10 installation (check the 464GB size) and E is the EFI system partition (473MB in size). This is important for the next command.

Now, exit out of diskpart and run the following command: bcdboot c:\windows /s e: /f UEFI

bcdboot

This creates new boot files pointing to your C:\windows installation, deposits them on the E: drive (which is the EFI System partition), and ensures it’s in the UEFI format. Pretty much everything that I covered earlier in the post. Alright! Exit the command line interface again, and¬†reboot. No need to power down now, since the BIOS is already in UEFI mode and the NVMe M.2 SSD is the only device attached. The system should now start your Windows 10 installation cleanly, although the first boot might take a second or two longer.

Actually, while typing this, E: might not be the right partition in this case, as it’s the OEM partition (see partition sizes in the pictures below). Most likely you will not have to use the /s and /f switches in the bcdboot command; try for yourself. Nevertheless, it worked!

Resize your partition

Wait, we’re not there yet! My SATA SSD was only 500GB, and the new M.2 one is 1TB. So this is wrong:

diskmgmt showing only 500GB

 

For this last step, it’s best to use AOMEI Partition Assistant. This is because, as you can see in the disk layout, the OEM partition is right next up to the C: drive. This blocks any expansions of said C: drive.

aomei unallocated space

What we’re going to do is move the OEM partition to the far right, and extend the C: volume.

If you click proceed, AOMEI Partition Assistant will boot into a Windows PE environment, perform the necessary actions and return you to Windows 10. Check the new capacity…

diskmgmt right capacity

Voila, you’re done!¬†Clone Windows 10 from SATA SSD to M.2 SSD succeeded!

Now, for the WD_Black SN750 NVMe M.2 SSD speeds…

Well, see for yourself ūüėČ

WD Black SN750 speed and specs

Again, a few disclaimers, before the entire benchmarking internet falls on top of me. For the first half of the benchmark, my system was still half loading and synchronizing files. Plus it’s still an old Windows 10 install, so far from optimized. For one, my NVMe drivers are still Windows default, which might affect speed. Also, not every motherboard is the same. I’ve got a 4-lane PCIe 3.0 bus, so that’s good, but some other boards might be quicker. Nevertheless, please take the numbers in this benchmark with not just a grain of salt, but a truck full of salt. They are mostly for “wow, this is much quicker than SATA-600!”-purposes.

I myself am pretty happy with the speeds. Over 3GB/s sequential read, with over 2.2GB/s sequential write. Random throughputs ranging from 100.000 to 300.000+ IOps. In real life: the system feels a fair bit more responsive compared to the ol’ SATA SSD. Job done!

[Disclaimer: Western Digital gave me the 1TB WD Black SN750 NVMe M.2 SSD at Storage Field Day 18. They did not request anything in return. The sole reason I wrote this post is because it took a frustrating amount of time to clone my OS to the new M.2 SSD, and I want to avoid other people from going through the same ordeal.]