Problem fixing my corrupted USB drive on OS X
You need to unmount the disk first. Before you can write to it using ddHere the command you need to run to unmount the disk:

sudo diskutil unmount /dev/disk2