An illustrated Mac OS X Terminal session shows the dd disk-imaging command and an image file destination.
Iโve found dd extremely useful when dealing with old disks and filesystems that Mac OS X doesnโt necessarily understand. Sometimes all I want is a complete image of a drive, without worrying about whether the Mac can read the files sitting on it.
Mac OS X 10.6 Snow Leopard was particularly awkward with Mac OS Standard / HFS media, since it treated that filesystem as read-only. Iโve also used dd to make images of Raspberry Pi storage containing Linux filesystems that OS X couldnโt natively access. Thatโs the nice thing about working with the disk at block level: I donโt need to mount the filesystem to copy the whole thing.
Using the raw-device form, rdisk rather than disk, made a considerable difference to the speed in my tests. I also tried Paragon ExtFS around this period, but it seemed to corrupt disks rather quickly in my setup. I canโt speak for every version of the software, but that was enough to send me looking for another approach!
Below are my original working notes. Theyโre a mixture of instructions and commands, not something to paste straight into Terminal without reading. My example drive was disk3, but yours probably wonโt be. Check the device with diskutil list, make sure the relevant volumes are unmounted, and double-check which path is the input and which is the output. Getting those backwards can overwrite a perfectly good disk. That would rather defeat the purpose!
Copy original USB device to disk image
Open Terminal
diskutil list (my USB drive was disk3)
sudo -s
Enter password
dd if=/dev/rdisk3 bs=1m of=/test.img
Wait a long time, check Activity Monitor for disk activity.
Copy disk image to new drive
Open Terminal
diskutil list (my USB drive was disk3)
sudo -s
Enter password
dd if=/test.img of=/dev/rdisk3 bs=1m
Wait a long time, check Activity Monitor for disk activity.
Update Oct 2015: Since OS X 10.11 El Capitan was released, I found a great little program called ApplePi-Baker, then at version 1.81. I was unsure whether the commands above still held up under El Capitan, but they had worked well for me in 10.6 Snow Leopard.