Manually cloning an SSD with Windows via CMD
This option will take longer, be more complicated, and may not work the first time. But it's free and helps you develop new disk handling skills.
⚠️ Important before you begin
- The new SSD must be at least as large as the original.
- All data on the new SSD will be deleted.
- CMD must be run as administrator.
- This method copies files through the file system; For a full bit-for-bit clone, it's best to use Macrium Reflect, Acronis, or Clonezilla.
1️⃣ Preparing a new SSD (DiskPart)
Create a GPT disk with the correct partition structure. If we're creating a clone, we're exactly copying the current disk's structure. You can view it using the Disk Management utility in Windows. To better understand the commands, watch the video at the bottom of the article.
diskpart //This is a program inside cmd
select disk 1 <!-- New SSD -->
clean
convert gpt
create boot partition
create partition efi size=100
format fs=fat32 quick
assign letter=S
create partition msr size=16
create primary partition
create partition primary
format fs=ntfs quick
assign letter=Z
create Recovery partition
create partition primary size=1024
format fs=ntfs quick
assign letter=R
set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac override
gpt attributes=0x8000000000000001 override
exit
EFI — bootloader, MSR — service partition, Z — primary Windows partition, R — Recovery (WinRE).
2️⃣ Copying Windows to a new SSD
Using robocopy. This command copies all files except some occupied system files (pagefile.sys, hiberfil.sys), which Windows will create automatically:
robocopy C:\ Z:\ /MIR /COPYALL /XJ /R:0 /W:0 /NP /NFL /NDL /LOG:C:\robocopy_log.txt
As the description above suggests, this copy from within Windows will fail because system files are in use. Therefore, the command prompt must be run from a bootable USB drive.
- /MIR — mirrors the folder structure
- /COPYALL — copies all attributes and permissions
- /XJ — ignores junction points
- /R:0 and /W:0 — no retries or waits
- /NP, /NFL, /NDL — speed up the process by hiding file output
- /LOG — saves the error log, if needed
3️⃣ Installing the bootloader on EFI
Creating a correct Windows bootloader in the EFI partition:
bcdboot Z:\Windows /s S: /f UEFI
- Z: — partition with Windows
- S: — EFI partition
- /f UEFI — creates a bootloader for UEFI
4️⃣ Configuring Recovery (WinRE)
After copying, create a working recovery:
mkdir R:\Recovery\WindowsRE
copy C:\Windows\System32\Recovery\Winre.wim R:\Recovery\WindowsRE\
reagentc /setreimage /path R:\Recovery\WindowsRE
reagentc /enable
reagentc /info
Check that WinRE is enabled. The Recovery partition must be hidden and without a drive letter.
5️⃣ Check and boot
- Shut down the PC and disconnect the old SSD (or select the new SSD first in the BIOS).
- In the BIOS, make sure UEFI mode is active.
- Boot Windows from the new SSD.
After a successful boot, all Windows and Recovery system files are created automatically, including pagefile, hiberfil, and SVI.
Byte-by-byte copy
dd / dd for Windows copies a disk byte-by-byte (sector-by-sector)
dd if=\\.\PhysicalDrive0 of=\\.\PhysicalDrive1 bs=1M --progress
- if — source disk
- of — new SSD
- bs=1M — block size
- Clones absolutely everything: Windows, EFI, MSR, Recovery, used files, hidden files
- ⚠️ Disadvantage: copies all sectors, even empty ones → requires an SSD ≥ in size
Important notes
- MSR — service partition, not formatted and is not visible in Explorer.
- Recovery and EFI should be hidden and without a drive letter.
- robocopy is slow because it copies each file through the file system. For a full clone, it's faster to use Macrium Reflect or Acronis.
- Error
in use. use override parameter— this means the partition is occupied; useoverridein diskpart. - For bit-by-bit copying of occupied files and a full clone, it's better to use
ddor third-party programs.
This instruction is suitable for manually cloning an SSD with Windows 10/11 via CMD and takes into account EFI, MSR, Recovery, and occupied files. If you follow all the steps, Windows will be fully functional and bootable on the new SSD.
Watch the video to learn how to do this both manually and using the program:
