How to Use the Linux dd Command to Clone Drives and Create Bootable USBs

When Linux administrators need to backup an entire hard drive, flash an ISO image to a USB stick, or securely wipe a disk, standard file-copying tools like cp or rsync are insufficient. Those tools only copy files within an existing filesystem. To copy raw data at the binary block level—ignoring files, folders, and partitions entirely—you must use the dd command. Often jokingly referred to as \”disk destroyer\” due to its unforgiving nature, dd is one of the most powerful utilities in the Linux ecosystem.

Why Use the dd Command?

The dd command performs a bit-for-bit mathematical copy. It reads raw bytes from an input file (which can be a physical device like a hard drive) and writes them directly to an output file. Because Linux treats all hardware devices as files located in the /dev/ directory, dd can clone the entire structure of a drive, including the master boot record, partition tables, and hidden recovery sectors. It is the definitive tool for creating bootable installation media from an ISO file.

Step 1: Identify Your Devices

Because dd will happily overwrite your primary operating system without asking for confirmation, you must absolutely verify the hardware identifiers before running the command.

  1. Open your Linux terminal.
  2. Run the lsblk command to list all attached drives.
  3. Identify your target device (e.g., your USB stick might be /dev/sdb or /dev/sdc). Pay close attention to the drive sizes to ensure you have the correct one.

Step 2: Create a Bootable USB from an ISO

This is the most common use case for dd.

  1. Navigate to the folder containing your downloaded ISO file.
  2. Run the dd command using sudo. The syntax uses if (input file) and of (output file).
sudo dd if=ubuntu-24.04-desktop-amd64.iso of=/dev/sdb bs=4M status=progress
  • if=: The source file (the ISO).
  • of=: The destination physical drive (not a partition like sdb1, but the entire drive sdb).
  • bs=4M: Sets the block size to 4 megabytes, significantly speeding up the transfer.
  • status=progress: Forces dd to output real-time transfer statistics, as it is normally completely silent until finished.

Step 3: Clone an Entire Hard Drive

You can also use dd to clone one physical drive directly to another, creating an identical backup.

  1. Identify your source drive (e.g., /dev/sda) and destination drive (e.g., /dev/sdb).
  2. Run the command:
sudo dd if=/dev/sda of=/dev/sdb bs=64K conv=noerror,sync status=progress
  • conv=noerror,sync: Instructs dd to keep copying even if it encounters a bad sector on the source drive, padding the error with zeros to maintain structural alignment.

Step 4: Securely Wipe a Drive

Because dd writes raw data, you can use it to completely obliterate the contents of a drive by overwriting it with zeros.

  1. Run the command:
sudo dd if=/dev/zero of=/dev/sdc bs=1M status=progress

This pulls infinite zeros from the Linux pseudo-device /dev/zero and writes them across the entire target drive, making data recovery effectively impossible.

By mastering the dd command, Linux administrators gain absolute, low-level control over drive imaging, cloning, and formatting.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.