Quick take: The dd command copies data block by block, used to write ISO images to USB drives and clone disks: sudo dd if=image.iso of=/dev/sdX bs=4M status=progress. It is powerful and unforgiving — the wrong of= can wipe a disk.
Introduction
The dd command copies data at the block level, which makes it ideal for low-level tasks: writing a bootable USB from an ISO, cloning a disk, or backing up a partition exactly. Its power comes with risk — dd writes wherever you point it, with no confirmation — so it has earned the nickname “disk destroyer”.
This guide covers the common, genuinely useful dd operations and, just as importantly, how to run them safely.
Syntax
The basic syntax of the dd command is:
dd if=SOURCE of=DESTINATION [OPTIONS]Common Options and Parameters
The most useful options and parameters for the dd command:
| Option | Description |
|---|---|
| if=FILE | Input file or device to read from. |
| of=FILE | Output file or device to write to. |
| bs=SIZE | Block size (e.g. 4M) — larger is usually faster. |
| status=progress | Show transfer progress while running. |
| count=N | Copy only N blocks. |
| conv=fsync | Flush to disk before finishing. |
| conv=noerror,sync | Continue past read errors (disk recovery). |
Practical Examples
Real dd commands you can run today:
# Write an ISO to a USB drive (check the device first!)
sudo dd if=ubuntu.iso of=/dev/sdX bs=4M status=progress
# Clone one disk to another
sudo dd if=/dev/sda of=/dev/sdb bs=64M status=progress
# Back up a partition to an image file
sudo dd if=/dev/sda1 of=/backup/part1.img bs=4M status=progress
# Restore an image to a partition
sudo dd if=/backup/part1.img of=/dev/sda1 bs=4M status=progress
# Create a 1 GB test file of zeros
dd if=/dev/zero of=test.img bs=1M count=1024Tips and Best Practices
- Triple-check the
of=target withlsblkfirst. Writing to the wrong device destroys its data with no undo. - Add
status=progressso you can see how far a long copy has got. - Use a large block size like
bs=4Mfor much faster transfers than the tiny default.
Final Thoughts
dd is the precise, low-level tool for writing ISOs, cloning disks, and imaging partitions — tasks where an exact block-for-block copy matters. Its danger is real: there is no confirmation and no undo, so always verify the output device with lsblk before running it. Used carefully, it is indispensable for installation media and disk backups.
FAQ: dd Command in Linux
How do I write an ISO to a USB drive with dd?+
Identify the USB device with lsblk, then run sudo dd if=image.iso of=/dev/sdX bs=4M status=progress, replacing sdX with the whole device (not a partition). Double-check the device name first.
How do I clone a disk with dd?+
Use sudo dd if=/dev/sda of=/dev/sdb bs=64M status=progress to copy the entire source disk to the destination. The destination must be at least as large as the source.
Why is dd called 'disk destroyer'?+
Because it writes exactly where you tell it with no confirmation. A mistyped of= target can overwrite the wrong disk and destroy its data irrecoverably, so verifying the device is critical.
How do I see dd's progress?+
Add status=progress to the command. Older versions show progress by sending the USR1 signal: kill -USR1 $(pgrep dd) prints the current status.
What block size should I use with dd?+
A larger block size like bs=4M is much faster than the small default. For disk-to-disk clones, bs=64M works well. Very large sizes give diminishing returns.
Need help with Linux servers or infrastructure?
Work directly with Muhammad Irfan Aslam for Linux, Ubuntu, Docker, DevOps, cloud, CI/CD, or infrastructure support.
Hire Me for Support