dd command generator
Build a dd command for the jobs people actually use it for: writing an ISO to a USB stick, imaging a disk, wiping a drive or creating a test file. Start from a preset, adjust the input, output and block size, and copy a command with every operand explained. Because dd writes raw blocks with no confirmation, the tool shows a loud warning the moment your output is a device. Generated entirely in your browser.
of= device erases it instantly and irreversibly. Always confirm the target with lsblk or diskutil list first, and double-check the device letter. Its nickname is “disk destroyer” for a reason.lsblk on Linux, diskutil list on macOS. A USB stick is usually the last device added; never target /dev/sda unless you mean your main disk.What this dd command generator does
dd copies data block by block between files and devices, treating disks as plain streams of bytes. That low-level power is why it can write a bootable USB or clone a partition that ordinary file copies cannot, and also why a single wrong character in the output path can wipe the wrong drive without warning. This generator builds the command from presets and clearly labelled fields, explains every operand, and flags the dangerous cases so you can copy with confidence.
Unlike most commands, dd uses operand=value syntax rather than dashed flags: if= is the input file, of= is the output file, bs= is the block size, count= limits how many blocks to copy. A typical USB-writing command, dd if=image.iso of=/dev/sdX bs=4M status=progress conv=fsync, reads the ISO and writes it to the raw device in 4 MB blocks, showing progress and flushing the cache at the end.
The operands that matter
| Operand | Meaning |
|---|---|
if= | Input file or device to read from. Use /dev/zero for zeros, /dev/urandom for random data. |
of= | Output file or device to write to. The dangerous one: a device path here is overwritten. |
bs= | Block size for each read/write. Larger blocks (1M, 4M) are much faster for whole-disk work. |
count= | Number of blocks to copy. Combine with bs to limit total size, e.g. bs=1M count=1024 makes 1 GB. |
status=progress | Print a live progress line. Otherwise dd is silent until done. |
conv=fsync | Flush all data to the device before exiting, so the write is actually complete. |
Common jobs
- Write an ISO to USB:
dd if=linux.iso of=/dev/sdX bs=4M status=progress conv=fsync. Unmount the USB first, target the whole device (/dev/sdb) not a partition (/dev/sdb1). - Back up a disk to an image:
dd if=/dev/sda of=backup.img bs=64K status=progress. Restore by swapping if and of. - Wipe a drive with zeros:
dd if=/dev/zero of=/dev/sdX bs=1M status=progress. For SSDs preferblkdiscardor the drive’s secure-erase. - Create a test or swap file:
dd if=/dev/zero of=test.img bs=1M count=1024makes a 1 GB file.
How to not destroy the wrong disk
Every horror story about dd comes down to the same mistake: the wrong device in of=. Build the habit of running lsblk (Linux) or diskutil list (macOS) immediately before, and matching the size and model to the device you intend. On Linux the main system disk is almost always /dev/sda or /dev/nvme0n1; a freshly inserted USB stick is the highest letter, like /dev/sdb or /dev/sdc. Never run dd with a device output as root unless you have just verified the path.
Privacy and how this tool runs
The command is built by JavaScript in your browser. No paths or device names are sent anywhere or logged. You can use the generator offline once the page has loaded.
Frequently asked questions
How do I write an ISO to a USB drive with dd?
dd if=image.iso of=/dev/sdX bs=4M status=progress conv=fsync, replacing /dev/sdX with your USB device from lsblk. Unmount the USB first (but do not eject it), target the whole device not a partition, and wait for conv=fsync to finish flushing before removing the stick.
What block size should I use?
For whole-disk or USB work, a large block size like bs=4M is much faster than the 512-byte default. For exact-size files use a block size that divides cleanly, such as bs=1M count=1024 for 1 GB. There is no single best value; 1M to 4M suits most modern hardware.
What does conv=fsync do and do I need it?
Without it, dd can report success while data still sits in the kernel write cache. conv=fsync forces a flush to the physical device before dd exits, so the operation is truly complete. Always use it when writing to removable media to avoid pulling the drive too early.
How do I see progress while dd runs?
Add status=progress (GNU coreutils 8.24+). On older systems, send the USR1 signal to the dd process from another terminal with kill -USR1 $(pgrep ^dd) to print a one-off progress line.
Is dd the best way to clone a disk?
It works but copies every block including empty space, which is slow on large disks. For cloning, partclone, Clonezilla or ddrescue are smarter: ddrescue in particular handles failing drives by retrying and logging bad sectors. Use plain dd for ISOs, small images and simple jobs.
What is the difference between /dev/sdb and /dev/sdb1?
/dev/sdb is the whole device; /dev/sdb1 is the first partition on it. When writing a bootable ISO you target the whole device so the partition table and boot sector are written too. When copying a single filesystem you might target a partition. Writing an ISO to a partition usually produces an unbootable stick.
Related tools and resources
More command builders from the same toolkit.













