How to clone a hard drive on Linux

Thiago Marsal Farias
2 min readSep 23, 2022

Most Linux distribution provides one tool to convert and copy a file or the entire hard drive. In the example below, let’s explore the most common and native solution called dd.

On Ubuntu, dd comes already available; however, you can install it in your distribution using your package manager if not present. It is available for most Linux distributions.

For instance:

dd if=/dev/sdb1 of=/dev/sdc1 bs=64K conv=noerror,sync

Let’s break down the command to have a better understanding:

if=FILE is the source
of=FILE is the destination
ibs=BYTES is the block size (default: 512)
conv=CONVS conversion file strategy. Sync I/O and in case of error will not stop

It’s important to know that block size interferes with transference speed. The default value is 512 bytes. However, using 64K will decrease the rate and increase reliability. In summary, a higher value improves the speed decreasing the integrity, while a lower value improves the reliability reducing the rate.

As observed in the image above, the dd tool successfully copied the first partition sdb1 into the second partition sdc1.

Resources:

https://man7.org/linux/man-pages/man1/dd.1.html

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Thiago Marsal Farias
Thiago Marsal Farias

Written by Thiago Marsal Farias

Passionate about mentoring teams, fostering innovation, and leveraging cutting-edge technologies to solve complex business challenges.

No responses yet

Write a response