How to speed up SD card writing speed (using /dev/disk*) on a MacBook Pro

performancesd card

I've been installing some linux distributions onto an SD card from my MacBook, although they take over an hour to transfer a few hundred MB (using dd and /dev/disk1).

dd output

If you look at the above output it's working at roughly 0.31 MB/s! The SD card is a Class 10, and my MacBook Pro is the 2.66 GHz Intel Core 2 Duo, 4 GB 1067 MHz DDR3, and OS X Lion 10.7.4. Here is the hardware report for the card reader:

Built in SD Card Reader:

Vendor ID: 0x05ac
Product ID: 0x8403
Revision: 1.00 Serial
Number: 9833

SDHC Card:

Capacity: 7.97 GB (7,969,177,600 bytes)
Removable Media: Yes BSD
Name: disk1
Partition Map Type: MBR (Master Boot Record)
S.M.A.R.T. status: Not Supported
Volumes:

PI:
Capacity: 7.96 GB (7,964,983,296 bytes)
File System: MS-DOS
BSD Name: disk1s1
Content: DOS_FAT_32

Any ideas why the transfer to /dev/disk1 is so slow and how I could speed it up?

Best Answer

Just ran into the same problem and it seems to be that /dev/disk* is slow because it is buffered. If you use the corresponding rdisk device (ex: /dev/rdisk1s1) you should get the speed you expect. This is apparently a BSD thing.

Example:

% sudo dd if=pi.bin of=/dev/disk1 bs=1m count=4095
^C408+0 records in
407+0 records out
426770432 bytes transferred in 1393.452305 secs (306268 bytes/sec)

% sudo dd if=pi.bin of=/dev/rdisk1 bs=1m count=4095
4095+0 records in
4095+0 records out
4293918720 bytes transferred in 378.669512 secs (11339489 bytes/sec)

Ref: