Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Windows 10 / How to Move (Clone) Windows to a New Hard Drive (HDD/SSD)?

March 16, 2021 Windows 10Windows Server 2016

How to Move (Clone) Windows to a New Hard Drive (HDD/SSD)?

In this article we will show how to copy (move) your Windows installation without reinstalling to another hard drive using built-in tools (without any third-party software like Paragon, AOMEI or Acronis). For example, this guide will help you to migrate your Windows from an HDD to a new SSD, clone an installed and configured Windows to another computer (there are some nuances) or a new larger hard drive.

As an example, we will clone an installed Windows 10 to a new drive using a bootable USB stick, command prompt and built-in robocopy tool.

Note that you will be able to clone an operation system by copying it to a new disk only if you migrate it on the same computer (or two computers with similar hardware). If you want to copy an installed Windows to a disk for another computer, you will have to get new drivers for disk controllers, chipset and videocard to boot the OS on a new hardware.

You can clone a hard drive to a new smaller drive if Windows occupies less space on the current drive than your new drive is in size. Otherwise, you will have to delete/move some files from the source drive. The most often, a question like this arises when migrating to SSDs, which are usually smaller than classic HDDs.

The procedure of migrating Windows to another drive depends on your computer’s firmware: BIOS or UEFI. Run the following command:

msinfo32

If you see Legacy in the BIOS mode value, your computer is using BIOS (or UEFI works in the Legacy/CSM mode). If you see UEFI, you have got a modern computer, and Windows is installed in the UEFI mode.

How to check if your PC is using legacy BIOS or UEFI on Windows 10 with msinfo32

  • If a computer works in the native UEFI mode and uses GPT partition table for a boot drive, I will tag commands for such computers with UEFI GPT
  • If you have an old computer with BIOS or UEFI working in the Legacy mode and the drive partition table is MBR, the commands will be marked as BIOS MBR

First of all, you must create partition table on your new drive. You can do it directly from running Windows 10 using diskpart. If the disk is new, initialize it with diskmgmt.msc or using the Initialize-Disk PowerShell cmdlet:

Get-Disk | Where-Object PartitionStyle –Eq 'RAW' | Initialize-Disk

initialize a new disk to clone the installed Windows instance

Then create a partition table on the new drive. Open the command prompt as an administrator and run this command:

diskpart

In the diskpart context, run the following commands:

list disk
select disk 1 (depending on the number of the new disk the previous command returned)
clean

Then the commands will differ depending on your platform type.

For UEFI GPT:

convert gpt
create partition efi size=100
format fs="FAT32" quick label="EFI"
create partition msr size=16
create partition primary
format fs="NTFS" quick label="NEW_SYSTEM"
exit

We have created a GPT partition table, two small service partitions (EFI and MSR) and a large partition occupying all the left space on the new drive (learn more about the GPT partition structure in Windows and EFI partition).

If there are some partitions on the drive, you can change the type of your partition table from MBR to GPT without data loss using the mbr2gpt.exe tool built into Windows 10.

Use the following commands for BIOS MBR:

convert mbr
create partition primary align=1024
active
format fs="NTFS" quick label="NEW_SYSTEM"
exit

create mbr partition table with diskpart

To clone Windows to a new drive, you will need a boot USB stick with a Windows 10 install image (it is easy to create it using MediaCreationTool).

Restart your computer and boot from the Windows 10 install media. When the Windows installation window appears, press Shift+F10 to open the command prompt. Run the following commands:

diskpart
list vol
exit

In the screenshot below, you can see that the E: disk letter is assigned to the original Windows partition on the old drive, and D: is assigned to the large partition (with the NEW_SYSTEM label) on the new drive.

If the disk letters are not assigned, you can fix it in diskpart as follows:
select disk 1
list part
select part 1
assign
list volume

check the assigned drive letters for old and new drives

Then copy files from the old drive with the installed Windows to the new one. The easiest way to do it is to use robocopy. The following robocopy command will copy all symbolic links, files and folders containing attributes, NTFS permissions and file timestamps. The copy log will be saved in the root of the target drive:
robocopy E:\ D:\ /E /COPYALL /COPY:DAT /SL /XJ /R:3 /W:3 /UNILOG:"D:\rcopy.log" /TEE

using robocopy to clone windows installation to a new HDD/SSD

It may take a long time to copy files depending on the size of your old disk (in my case, it took about an hour to copy a 60 GB disk).

Then you can shut down your computer and remove your old hard drive.

The next step is to configure the Windows bootloader on the new disk.

If you try to boot from the new disk without fixing the boot records, the Operation system not found error will appear.

Boot your computer in Windows installation environment again and open the command prompt (Shift+F10).

Restore the bootloader on BIOS MBR device.

Check the disk letter assigned to the new large partition on the drive:

diskpart
list vol

The drive letter C: is assigned.

Copy the BCD bootloader files on the drive C:

bcdboot C:\Windows /S C:

Change the MBR record and update boot entries in the BCD configuration file:

bootrec.exe /FixMbr
bootrec.exe /FixBoot
bootrec.exe /RebuildBcd

bootrec - recreate bootloader configuration for bios mbr device with windows 10

Here is how to restore an UEFI GPT bootloader on a computer (learn more in the article on how to repair EFI Bootloader on Windows 10).

Get the system drive letter and assign a disk letter to the EFI partition.

Diskpart
List vol

efi partition on windows 10

In this example, drive letter C is assigned to the system partition. You must assign a letter to the EFI partition (100 MB and FAT32) using the following commands (change the partition numbers according to your configuration):

select volume 1
assign letter M:
exit

Now you need to recreate the BCD bootloader and boot configuration:

cd /d m:\efi\microsoft\boot\
ren BCD BCD.bak
bcdboot c:\Windows /l en-us /s M: /f ALL

Restart your computer and remove the boot USB stick. Make sure that Windows 10 has booted correctly from your new drive.

boot windows 10 from a new hard drive/ssd

All installed apps, files and settings remained in place. You have successfully copied an installed Windows 10 to a new drive.

When you copy files to a new disk using robocopy, some errors may occur. Open rcopy.log on your new drive to see what files have not been copied. In my case, 94 files were not copied (only junk and temporary files were not copied).

robocopy log file

The article doesn’t describe how to create a boot record for Windows Recovery Environment. Usually it is located on a separate System Reserved partition. If you want to configure Windows Recovery Environment (WinRE), follow the instructions in this article.

5 comments
3
Facebook Twitter Google + Pinterest
previous post
Zabbix – Simple ICMP Ping Checks
next post
Fixing “Winload.efi is Missing or Contains Errors” in Windows 10

Related Reading

How to Connect VPN Before Windows Logon

November 14, 2023

Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

November 7, 2023

Zabbix: How to Get Data from PowerShell Scripts

October 27, 2023

Tracking Printer Usage with Windows Event Viewer Logs

October 19, 2023

How to Use Ansible to Manage Windows Machines

September 25, 2023

5 comments

Richard Moby February 14, 2021 - 4:35 pm

The title is wrong: it must read “How NOT to clone…”

Reply
Dylan Detail March 31, 2021 - 10:49 am

Thanks, super awesome guide!

Small nit: You should probably change the robocopy command and omit the /COPY:DAT argument (/COPYALL makes it redundant and in fact specifying /COPY:DAT might overwrite the /COPYALL).

Reply
Karol May 21, 2021 - 2:00 am

Great comment. I have the same observation.

Reply
GVablo July 2, 2021 - 11:45 am

It is easy via using tools like Gs Richcopy 360, Carbonite, or SyncToy, search all

Reply
asic August 17, 2021 - 6:36 am

It is a fairly sophisticated rout using intermediator a “bootable USB” +HD
Qn
Having a bootable USB; what are other (system) folders that need to be copied to the bootable USB to make it the C:\ driver
Perhaps i should ask is the above possible..
(namely, moving C: to a USB)

You stand alone by the details you provided. Many thanks, A.

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • How to Connect VPN Before Windows Logon

    November 14, 2023
  • Removing Azure Arc Setup Feature on Windows Server 2022

    November 9, 2023
  • Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

    November 7, 2023
  • Send Emails with Microsoft Graph API and PowerShell

    November 6, 2023
  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • How to Repair EFI/GPT Bootloader on Windows 10 or 11
  • How to Restore Deleted EFI System Partition in Windows
  • Network Computers are not Showing Up in Windows 10/11
  • Updating List of Trusted Root Certificates in Windows
  • How to Create a Wi-Fi Hotspot on your Windows PC
  • How to Sign an Unsigned Device Driver in Windows
  • How to Download APPX File from Microsoft Store for Offline Installation?
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top