Skip to content

Did you know?

After writing an ISO with dd, cmp -n can prove the USB stick holds an exact copy.

cmp -n $(stat -c%s file.iso) file.iso /dev/sdX after dd; no output means identical.

Explained

A bootable USB that “doesn’t boot” is often a bad copy: a cheap stick, a flaky port, or unplugging too early. You don’t have to guess. Compare the stick with the ISO, limited to the ISO’s size because the stick is larger:

sudo cmp -n $(stat -c%s file.iso) file.iso /dev/sdb && echo "Copy OK"

If anything differs, cmp prints the first mismatching byte, for example differ: char 1000001. In our test with the Alpine 3.24.4 ISO, an exact copy printed “Copy OK”, and changing a single byte on the stick was caught immediately. Check the download itself first with sha256sum -c.

Learn more

← All tech tips · Suggest a fix

Back to top