dd copies raw bytes from one place to another — and its nickname, "disk destroyer", is earned honestly. It writes exactly what you ask, exactly where you ask, with no questions asked. Learn it slowly, use it deliberately, and it becomes the honest tool for disk images, bootable USBs, and exact copies.
The shape of every dd command #
$ dd if=source of=destination bs=4M status=progress
if is input file, of is output file. Everything else is tuning. There are no safety rails: of= a real device and dd will happily overwrite whatever was there.
The legitimate jobs #
Write an ISO to a USB stick — the daily classic:
$ dd if=aospix-1.0.iso of=/dev/sdc bs=4M status=progress oflag=direct
Back up an entire disk or partition as a single file:
$ dd if=/dev/sda2 of=sda2.img bs=4M status=progress
Rescue the copy elsewhere, or extract a range with skip and count:
$ dd if=disk.img of=part.img bs=1M skip=2048 count=1024
| Option | Meaning |
|---|---|
bs=4M | Read and write 4 MB blocks — the speed knob |
status=progress | Show live progress instead of silence |
skip=N / count=N | Start N blocks in; copy only N blocks |
oflag=direct | Bypass caches for USB writes |
conv=sync,noerror | Keep going on read errors (rescue mode) |
The safety rituals #
Confirm the target before pressing enter — twice:
$ lsblk -d -o NAME,SIZE,MODEL
$ # /dev/sdc really is the 16G USB stick, not your 1T disk
Then sync before unplugging; dd returns before the kernel flushes:
$ sync
For file-level copies that skip identical data, rsync is the everyday tool; dd is for when you need the bytes themselves. Related: mount and fstab, and the whole terminal notes series.
