dd performance on Mac OS X vs. Linux
I was trying to copy an iso of the windows installer onto a hard drive to avoid burning a disk. I first tried Disk Utility's restore function, however it didn't like the ISO for some reason. Then I tried using dd:
dd if=/path/to/image.iso of=/dev/disk3
I realized it was copying the file at a snail's pace, about 160 KB/sec. I rebooted into my linux installation and ran the command again, almost verbatim:
dd if=/path/to/image.iso of=/dev/sdc
This time the command executed in under a minute, with an average speed of 57 MB/sec. In both cases the source and destination were the same physical hard drives. What's going on?
I am running OSX 10.7.3 and Linux 2.6.38-13.
Solution 1:
For OS X, use /dev/rdisk3
.
For some reason rdisk
is faster than disk
. I believe it has to do with buffers.
Also in general using the bs
flag with dd
helps with speed.
dd if=/path/to/image.iso of=/dev/sdc bs=1M
The bytesize is 1M which transfers faster. On OS X you have to use 1m
(lowercase) instead of 1M
.