Although I considered asking this question in apple.stackexchange, my gut tells me the 'NIX crowd is more likely to produce a better response.

In what ways is the dd (OS X version) command any different from UNIX (I use Ubuntu). I would like to duplicate an SD card with dd as prescribed in the link with OS X.

An excerpt from the OS X dd man page:

     The dd utility copies the standard input to the standard output.  Input
     data is read and written in 512-byte blocks.  If input reads are short,
     input from multiple reads are aggregated to form the output block.  When
     finished, dd displays the number of complete and partial input and output
     blocks and truncated input records to the standard error output.

There are small differences like the missing status option in the BSD dd, but I wouldn't worry too much about that. AFAIK the core options are the same.

Run the following commands as root, replace diskX / diskY with your disk identifiers (like disk1 or disk2):

# list all disks to find your disk identifier
diskutil list

# unmount your sd card if it is mounted (see `df` or `mount`)
diskutil unmountDisk /dev/diskX

# copy of your sd card to an image file 
dd if=/dev/rdiskX of=sdcard.img bs=1m

# or copy your image file back to an sd card
dd if=sdcard.img of=/dev/rdiskX bs=1m

# or copy your sd card to a different device
dd if=/dev/rdiskX of=/dev/rdiskY bs=1m

Note that I used /dev/rdisk (raw disk) which is usually faster than the buffered /dev/disk.

To see the progress while dd is running you can press Ctrl-T (see here).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.