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

Loading

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

 Nedeštruktívne Technoogie ktoré nikde nekúpiš. 

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

Please note that you can clone the operating system by copying it to a new drive only if you are migrating it on the same computer (or between two computers with similar hardware). If you want to copy an installed Windows system to a drive for another computer, you will need new drivers for the disk controllers, chipset, and graphics card to boot the operating system on the new hardware.

You can clone a hard drive to a new, smaller drive if Windows occupies less space on the current drive than the capacity of your new drive. Otherwise, you will need to delete or move some files from the source drive. This question most often arises when migrating to SSDs, which are usually smaller than conventional HDDs.

The procedure for 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 uses BIOS (or UEFI is running in Legacy / CSM mode). If you see UEFI, you have a modern computer, and Windows is installed in UEFI mode.

  • If the computer is running in native UEFI mode and uses a GPT partition table for the boot drive, I will mark commands for these computers with the label UEFI GPT
    If you have an old computer with BIOS or UEFI running in Legacy mode and the disk partition table is MBR,
  • the commands will be marked as BIOS MBR

First, you need to create a partition table on the new drive. You can do this directly from Windows 10 using diskpart. If the disk is new, initialize it using the file diskmgmt.msc or using the Initialize-Disk PowerShell cmdlet:

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

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

Advertisements

diskpart

In the diskpart context, run the following commands:

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

The commands will then 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 free space on the new drive (for more information, see GPT partition structure in Windows and EFI partition).

Use the following commands for BIOS MBR:

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

To clone Windows to a new drive, you will need a bootable USB flash drive with a Windows 10 installation image (you can easily create one using MediaCreationTool).

Advertisements

Restart the computer and boot from the Windows 10 installation media. When the Windows Setup 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 drive letter E: is assigned to the original Windows partition on the old drive, and D: is assigned to the large partition (labeled NEW_SYSTEM) on the new drive.

If drive letters have not been assigned, you can fix this in diskpart as follows:

select disk 1
list part
select part 1
assign
list volume

Then copy the files from the old drive with Windows installed to the new one. The easiest way to do this is to use robocopy.

The following robocopy command copies all symbolic links, files, and folders, including attributes, NTFS permissions, and file timestamps. The copy log is saved in the root directory of the destination drive:

robocopy E:\ D:\ /E /COPYALL /COPY:DAT /SL /XJ /R:3 /W:3 /UNILOG:"D:\rcopy.log" /TEE

Copying the files may take a long time, depending on the size of your old drive (in my case, copying a 60 GB drive took about an hour).

You can then turn off the computer and remove the old hard drive.

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

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

Restore the bootloader on the device BIOS MBR.

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

diskpart
list vol

It has been assigned the drive letter C:.

Copy the BCD bootloader files to drive C:

bcdboot C:\Windows /S C:

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

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

Find the system drive letter and assign a drive letter to the EFI partition.

Diskpart
List vol

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

select volume 1
assign letter M:
exit

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

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

Restart the computer and remove the bootable USB flash drive. Make sure Windows 10 has booted correctly from your new drive.

All installed applications, files, and settings remain in place. You have successfully copied the installed Windows 10 system to a new drive.

Errors may occur when copying files to the new drive using robocopy. Open rcopy.log on your new drive to see which files were not copied. In my case, 94 files were not copied (only junk and temporary files were left uncopied).

(Source: ides.cz)

Advertisements
AliExpress

Leave a Reply

Your email address will not be published. Required fields are marked *