Before you type of=, confirm the device name with diskutil list (macOS) or lsblk (Linux) — never guess from memory. A wrong of= silently overwrites another drive with no confirmation prompt. Everything else on this page is demonstrated on scratch files, not devices.
Table of Contents
Identify the device first
On macOS there is no /dev/sda at all — that naming is Linux’s. Run diskutil list and read the identifier column:
$ diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *1.0 TB disk0
1: Apple_APFS_ISC Container disk1 524.3 MB disk0s1
2: Apple_APFS Container disk3 994.7 GB disk0s2
3: Apple_APFS_Recovery Container disk2 5.4 GB disk0s3
macOS also exposes two device nodes per disk — /dev/diskN (buffered) and /dev/rdiskN (raw/character):
$ ls -la /dev/disk0 /dev/rdisk0
brw-r----- 1 root operator 0x1000000 Aug 2 10:45 /dev/disk0
crw-r----- 1 root operator 0x1000000 Aug 2 10:45 /dev/rdisk0
The leading b vs c is block vs character device. For dd to an external drive, /dev/rdiskN is the conventional choice and is substantially faster than the buffered node — but confirming which number is your target, via diskutil list immediately before the command, matters far more than which node. On Linux the equivalent check is lsblk or sudo fdisk -l, and the device names really are /dev/sdX or /dev/nvme0n1. Don’t port a device name across operating systems; re-derive it every time.
conv=noerror,sync does not mean “successfully recovered”
The GNU coreutils manual (dd invocation) spells out what conv=noerror,sync does: noerror continues after a read error, and sync pads every short or failed input block with NUL bytes so the output stays the same length. Combined, the documented behavior is exactly that — continue past bad sectors and fill the gap with zeros. macOS’s BSD dd documents the identical mechanism (man dd, executed here):
noerror Do not stop processing on an input error. ... If the sync
conversion is also specified, any missing input data will be
replaced with NUL bytes ... and processed as a normal input buffer.
That means a drive with 200 bad sectors produces an image that is the correct total size and opens without error — and is silently wrong in up to 200 places, indistinguishable from a region that was legitimately all zeros. Demonstrated on a scratch file (10,000 bytes, block size 3,000, conv=sync pads the final short block to a full 3,000-byte block with NULs):
$ dd if=src.bin of=out.bin bs=3000 conv=sync
4+0 records in
4+0 records out
12000 bytes transferred
$ xxd -s 9900 -l 160 out.bin
0000270c: 4660 8ce8 0000 0000 0000 0000 0000 0000 F`..............
0000271c: 0000 0000 0000 0000 0000 0000 0000 0000 ................
...
Real data ends at byte 10,000; everything after is 00 padding that dd added, not data that was on the source. For an actually failing disk, treat conv=noerror,sync as “I will get an image the right size, with unreadable regions silently zeroed” — not as a successful recovery. A purpose-built tool like ddrescue, which logs exactly which byte ranges failed, is the documented choice for real data recovery; plain dd is not.
status=progress works on macOS
It might seem that status=progress is GNU-coreutils-only and that BSD dd would reject it. Tested directly — it does not:
$ dd if=/dev/zero of=/dev/null bs=1m count=5 status=progress
5+0 records in
5+0 records out
5242880 bytes transferred in 0.000186 secs
$ man dd | grep -A2 'status=value'
status=value
Where value is one of the symbols from the following list.
progress Print basic transfer statistics once per second.
Current macOS dd (BSD) accepts status=progress directly. If you’re on an older BSD dd that predates this, or want a progress readout mid-copy without adding a flag, send it SIGINFO — press Ctrl+T in the terminal running dd — which is BSD’s native mechanism (also documented in man dd on this machine) and predates status=progress by decades. Linux dd has no SIGINFO; use status=progress there, or send SIGUSR1.
Safe things to practice on a file, not a device
count=, skip=, and seek= are all block-size-relative and easy to get wrong under pressure. All verified on scratch files (script output below):
# count=N: read only N blocks — output is exactly N*bs bytes
$ dd if=src.bin of=out.bin bs=1000 count=4 # -> 4000-byte output
# skip=N: skip N blocks of the INPUT before reading
$ dd if=src.bin of=out.bin bs=1000 skip=2 # copies bytes 2000..end
# seek=N: skip N blocks into the OUTPUT before writing (needs conv=notrunc
# to avoid truncating what came after)
$ dd if=src.bin of=out.bin bs=1000 count=2 seek=3 conv=notrunc
# a partial final block is not an error and is not silently dropped:
# a 10000-byte file copied with bs=3000 produces 3+1 records and a
# byte-identical 10000-byte output, with no conv= flag needed
$ dd if=src.bin of=out.bin bs=3000
3+1 records in
3+1 records out
That N*bs arithmetic is also the whole of the fastest way to conjure a test corpus: one dd write of the total size, then split to cut it into pieces. Ten thousand ten-byte files needs a 100,000-byte master file, and getting the multiplication wrong is how you end up with ten times the files you meant.
Run /verify/dd-command-examples.sh to repeat every file-based test above and the status=progress check on your own machine; it never touches a device node. For handling the ISO side of a bootable-USB workflow specifically, see mounting an ISO image. The scripts behind my other articles are collected in the index of all verify scripts.