1

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:

DESCRIPTION
     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.
gatorback
  • 1,384
  • 23
  • 48

1 Answers1

2

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).

Freddy
  • 25,565