A faster way to copy your Raspberry Pi SD cards on OS X

Posted by Jen Tong on June 26, 2015

The Raspberry Pi is awesome. One of the reasons that it’s awesome is because it’s so newbie friendly, and has great docs. For example, it has a great guide on creating an SD card image from OS X.

But, that guide does have one problem. The way they tell you to use the dd tool results in a very slow copy.

Default Instructions

Here’s what happened when I followed the instructions to install Raspbian on a cheap SD 16 GB SD card.

mimming@femputer:~$  sudo dd bs=1m if=2015-05-05-raspbian-wheezy.img of=/dev/disk2
Password: correcthorsebatterystaple

3125+0 records in
3125+0 records out
3276800000 bytes transferred in 2903.165983 secs (1128698 bytes/sec)

2903 seconds? That’s like 48 minutes. That’s almost an hour! But, but, but I want to be hacking sooner than that.

Targeting rdisk

Luckily there’s another way! OS X provides /dev/rdisk#. The r stands for raw and provides a more direct interface with the SD card. In this case, more direct = more faster.

mimming@femputer:~$ sudo dd bs=1m if=2015-05-05-raspbian-wheezy.img of=/dev/rdisk2
Password: correcthorsebatterystaple

3125+0 records in
3125+0 records out
3276800000 bytes transferred in 652.856126 secs (5019176 bytes/sec)

The same copy took just over 10 minutes. Not too shabby.

Bigger Chunks

Some Stack Overflow answers indicated that using bigger chunks might speed things up even more. I gave it a try.

mimming@femputer:~$  sudo dd bs=10m if=2015-05-05-raspbian-wheezy.img of=/dev/disk2
Password: correcthorsebatterystaple

312+1 records in
312+1 records out
3276800000 bytes transferred in 653.281030 secs (5015912 bytes/sec)

The result is almost exactly the same. It seems that block size does not matter too much.

A tip about dd progress

While dd is a neat tool, it’s hardly verbose. Sometimes it’s hard to tell if it’s working hard, or if the process is hung (which can happen if your computer goes to sleep).

You can query it for a status update by pressing CTRL + T.

Thanks to that goes to this superuser answer.