Skip to content

dcfldd

A forensic fork of dd: writes a pattern across a disk, hashes as it goes, and tells you how far it has got.

Homebrew formula

What it does

Everything dd does, plus the things that make it usable for wiping and imaging: a repeating write pattern, on-the-fly hashing of what was read or written, a progress display, split output files, and a verify pass against the source.

diskutil unmountDisk /dev/disk4
sudo dcfldd pattern=00 of=/dev/rdisk4 statusinterval=64     # single-pass zero fill
sudo dcfldd if=/dev/rdisk4 hash=sha256 hashlog=disk4.sha256 of=disk4.img
of= is written to without confirmation. A wrong identifier overwrites the wrong disk, and sudo means nothing will stop you. Confirm with diskutil list first, every time.

Notes

  • The hash log is what makes it forensic rather than merely convenient: you can prove the image matches the disk, or that the wipe wrote what it claimed.
  • Same limitation as every host-side overwrite — wear levelling keeps spare blocks out of reach. For an SSD, a firmware sanitise or key destruction is the real answer.
  • Use the raw device (/dev/rdisk4) for speed.

Alternative to

AlternativeTypeTrade-off
ddBuilt inAlready installed, no patterns, no hashing, no progress
diskutil secureEraseBuilt inKnows about macOS volumes, offers canned pass counts, no hashing
GNU ddrescueOpen sourceThe tool for reading failing disks rather than writing over healthy ones
ShredOSOpen sourceWipes every disk in a machine from boot media, with a certificate

Install

brew install dcfldd

Links

This post is licensed under CC BY 4.0 by the author.
Last updated on