Solution: dd too slow on Mac OS X

When I was cloning SD cards on Mac OS X using dd', it takes ages to get things done. I was using the following command:

It takes much less time when using /dev/rdisk2 instead of /dev/disk2:

The reason is that rdisks are "raw" thus resulting in a higher R/W speed, according to man hdiutil` [1]:

/dev/rdisk nodes are character-special devices, but are “raw” in the BSD sense and force block-aligned I/O. They are closer to the physical disk than the buffer cache. /dev/disk nodes, on the other hand, are buffered block-special devices and are used primarily by the kernel’s filesystem code.


56 thoughts on “Solution: dd too slow on Mac OS X

  1. Pingback: Usar dd mas rapido en MacOS X para imágenes de Raspberry - Que he aprendido hasta ahora (QHAHA)

  2. Pingback: Speed up dd write speed on OSX | The NSCoder

  3. Pingback: 在Linux/Mac中使用「dd」指令燒錄 .ISO 鏡像至USB硬碟 | 暢想資源

  4. 3284139520 bytes transferred in 19705.137328 secs (166664 bytes/sec)


    3284139520 bytes transferred in 255.784407 secs (12839483 bytes/sec)


    Thanx! 🙂

  5. So I can keep my Mac and don’t throw it away! Thanks a LOT, x16 speed on a USB stick!


  6. Thanks a lot man!!! You saved my life!!!!

    I have a fast external disk that I want to backup to the local MAC disk and an USB 3.0 SATA adapter and got only 30 Mbytes/s.

    Now is 300Mbytes/s!!!!!





  7. Thanks a lot !!
    Here with pv command to see the copy progress 😉
    dd bs=1m if=~/Downloads/20131009.alice.img | pv | sudo dd bs=1m of=/dev/rdisk2

  8. WOW, this made all the difference it the world!! add the pv command (not needed as much now due to how fast it is) and I can get back to work.

  9. Thanks a lot !!
    Here with pv command to see the copy progress ?
    dd bs=1m if=~/Downloads/20131009.alice.img | pv | sudo dd bs=1m of=/dev/rdisk2

    I’d use:
    sudo -s — “dd bs=1m if=imagefile.img | pv | dd bs=1m of=/dev/rdisk2”
    Because you have to run dd with root privileges.

  10. Pingback: Building Swift 3.0 on a Raspberry Pi 3

  11. Damn I read this too late, now I won’t kill the process because the whole image is “only” 3,3 GB:

    sudo killall -INFO dd

    2459+0 records in
    2458+0 records out
    2577399808 bytes transferred in 5596.141697 secs (460567 bytes/sec)


  12. Same for databases (like 50%+ faster running off raw devices) but rarely used there because there’s too high chance junior sysadmins / devs will confuse your database storage for empty disks 🙁

  13. Bonus: for those who use pv for getting a progress meter:
    Use dd from gnu coreutils (both macports and homebrew should have it) and then append

    to your command.

  14. Sorry for the newbie question, but I keep getting a “dd: /dev/rdisk5: Operation not permitted”  when I enter “sudo dd bs=1m if=/Users/me/Desktop/file.img of=/dev/rdisk5”  Not sure what I’m doing wrong.

  15. Nm, I just found out what I did wrong.  I realized that my sd card changed to disk6 instead of disk5.  Doh

  16. Pingback: 在树莓派 3 上构建 Swift 3.0-IT文库

  17. Pingback: Android Things Day 0-5 – Androidev

  18. Pingback: OSX fast copy | rodez I/0

  19. Apple:~ apple$ sudo dd if=/Users/apple/Desktop/2017-07-05-raspbian-jessie-lite.img of=/dev/rdisk1 bs=1048576
    load: 0.59 cmd: dd 1621 uninterruptible 0.00u 0.92s
    1130+0 records in
    1129+0 records out
    1183842304 bytes transferred in 2143.597669 secs (552269 bytes/sec)

    size of jessie -> 1,72,56,29,563 bytes (1.73 GB on disk)

  20. Pingback: Backing up your Pi’s SD card – Luis Puerto

  21. Pingback: dd on mac osx – Die kleine Welt der Meinungsfreiheit

  22. bail(){
    echo “Usage: $0 source destination”
    exit 1

    echo “Usage: $0 source destination – path invalid”
    exit 1

    [[ -z “$1” || -z “$2” ]] && bail
    [[ ! -e “$1” || ! -e “$2” ]] && nofile

    read -p “Are you sure? Y/[N] ” -n 1 -r
    echo # (optional) move to a new line
    [[ ! $REPLY =~ ^[Yy]$ ]] && exit 1

    FSZE=$(stat -f “%z” $1)
    su root -c “dd bs=$BLKSZ if=$1 | pv -s $FSZE | sudo dd of=$2 bs=$BLKSZ”

  23. 818+0 records in
    818+0 records out
    857735168 bytes transferred in 75.526248 secs (11356782 bytes/sec)


  24. Thanks a lot!

    Another tip for OSX (High Sierra) to check status during the process (pv not installed).

    In another Terminal window:

    sudo kill -INFO $(pgrep ^dd)


  25. I’m dying from the slowness as well, but using the r trick isn’t working for me. I get the following error:

    dd: /dev/rdisk4: Invalid argument

    Any idea how to fix that?

Leave a Reply

Your email address will not be published.