Computer

Copy Windows to SSD without paid programs, with dd and Linux

Copy Windows to SSD without paid programs, with dd and Linux

Switch from an old hard disk to a modern and fast SSD, even based on a PCIe NVMe interface, or replace a solid state drive with a SSD Of larger dimensions It’s a pretty common need. The data volume stored on the PC’s storage drives tends to grow inexorably over time and we often find ourselves with a disk or SSD of insufficient capacity. There are multiple utilities that allow you to copy Windows to SSD: generally they are programs that start from a boot drive, such as a USB stick.

This is because it is good clone a Windows installation when the operating system is completely unused, there are no processes running that could adversely interfere with the file copy operation, and all user documents are stored in the correct memory locations.

To clone hard disk to SSD for free or copy data from one drive to another larger one, you can use the excellent Macrium Reflect. The bad news is that from January 2024 the developers have decided to withdraw Macrium Reflect Free by no longer offering it through the official website. The program can be downloaded for free from this link but the free version is no longer supported. And it’s still a real shame because for some time there user license of Macrium Reflect Free allowed its use without limitations even in commercial environments.

Use dd and GParted to copy Windows to SSD without any restrictions

Other software manufacturers that facilitate the data cloning between hard disk and SSD or from one solid state drive to another, often prohibit thefree use of their applications in contexts other than domestic ones or in any case for exclusively personal use.

For the benefit of more savvy users, who are tired of following the constant “twists and turns” of some software developers, we present a procedure that allows you to copy Windows to SSD, starting from another medium, without ever resorting to paid applications. The methodology we illustrate is based entirely on the use of a Linux distribution, on free software for partitioning disk drives GParted and on command dd of systems Unix-like which is responsible for copying data in blocks.

Prepare your own “toolbox”

First, we recommend visiting the GParted download page and then downloading the distribution ISO file containing the partitioning software and dd utility.

The link highlighted in the following figure allows you to download the version of GParted for i x86-64 system; the link below, however, allows you to download the release intended for 32-bit systems.

Copy Windows data to SSD with Linux utilities

Once the download is complete (the GParted distribution weighs just 500 MB), you can write it to one USB pendrive using for example the free balenaEtcher program.

Before proceeding further, we invite you to read our article in its entirety because there is an important consideration to make about the systems that use BitLocker (more on that later).

After started the system from the boot USB stick created with balenaEtcheryou can simply select the item GParted Live (Default settings) therefore making sure that the Europen keyboard layout is activated. With the procedure presented below you will be pleasantly surprised at how you can copy Windows to SSD using one distro Linux.

Avvio GParted live USB

Locate the source drive and destination drive

The GParted utility is automatically started as soon as you boot from your distribution’s USB media. The drop-down menu at the top right helps you identify the source drive (the one from which you want to copy data) and the destination drive (for example the new SSD larger). Each unit can be identified with a unique identification string (for example /dev/sda, /dev/sdb, /dev/nvme0n1 and so on). The important thing, at this stage, is not to confuse the source unit and the destination unit.

To remove any doubts, you can move the GParted window more to the center of the screen and then double-click on the icon Terminal shown on the desktop. The command sudo smartctl -i /dev/sda allows you to check the technical data (including model and capacity) of the indicated unit.

SSD drive features: check with smartctl

The “magic” command to clone storage drives, hard disks and SSDs

The Linux terminal window is useful for imparting the dd command. His name comes from “data dump” o “disk dump” because its main use consists in copying blocks of data from a source to a destination.

The dd command should be used very carefully, as it can irreversibly overwrite data and cause information loss if used incorrectly. For this reason, as highlighted above, it is essential to be certain of the identifiers corresponding to the source and destination units of the data.

Assuming the source drive is called /dev/sda and that of destination /dev/sdbyou can use dd as follows:

sudo dd if=/dev/sda of=/dev/sdb bs=4M status=progress

The option if (input file) specifies the data source; of indicates the destination. The parameter bs=4M sets the size of data blocks read and written (in this case 4 MB). The option status=progress provides information on the progress of the operation, showing the amount of data copied and the elapsed time.

Resize the partitions to take up all available space on the new drive

After cloning with dd is complete, you can return to the GParted window, select the destination drive (which now contains all the data from the source media).

Usually, the largest Windows partition is the middle one. Using GParted it is a good idea to first select the one on the far right making sure that it is in the field Free space after the value 0 MB is indicated. There main partition must in turn be resized so that it is up Free space first what up Free space after the values ​​0 MB appear.

Resize Windows partitions

To access the mechanism resizing partitionsjust click on a partition then choose the menu Partition and finally the command Resize/Move.

In this regard, it is essential to know that GParted does not allow scaling BitLocker partitions. They are in fact encrypted partitions that cannot and must not be manipulated like other partitions. If you were using BitLocker encryption on your system to protect stored data, this is first essential disable BitLocker using the command manage-bde -off c: (where C: is the drive letter where BitLocker is in use).

This instruction must be given from a Windows environment and, in particular, from one terminal window opened with administrator rights. In some cases, users are unaware that BitLocker is enabled on their Windows 10 or Windows 11 system. Before booting with GParted, therefore, it is in any case essential to check the status of BitLocker and, if activated, disable this protection feature.

Fix an error when opening GParted

If, when starting GParted, you get the error “Invalid argument during seek for read on…“, you can correct the situation very simply. The problem arises from the fact that the GUID Partition Table (GPT) uses a backup partition from the partition structure at the end of the drive and does not recognize its presence on the new drive.

To resolve, simply type the following in the terminal window:

sudo gdisk /dev/sdb

GDisk, GPT fix

Obviously a /dev/sdb the destination drive to which the data was just copied must be replaced. By accessing “expert mode” by typing X and by pressing Enter, you can then send the command E, by pressing the key on the keyboard, to place the partition table backup data back at the end of the drive. As a final step, you can press W to confirm the actual writing of the data and finally provide a final confirmation with Y.

The evolution of dd is the command ddrescue which we presented in another article to clone a damaged disk and recover data.

Opening image credit: iStock.com – Believe_In_Me

Leave a Reply

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