解决macOS使用dd指令写入/读取速度过慢的问题

解决macOS使用dd指令写入/读取速度过慢的问题

在制作树莓派TF卡时,发现macOS下dd速度奇慢无比,无论写入还是读取,大概只有4M/s


这是常规的命令:

sudo dd if=/dev/disk2 of=dump.img bs=1m

速度只有


然后改用/dev/rdisk2后,速度就上去了

sudo dd if=/dev/rdisk2 of=disk.img bs=4m

在节点名前r是什么呢?

观察手册

man hdiutil
Since any /dev entry can be treated as a raw disk image, it is worth noting which devices can be accessed when and how. /dev/rdisk nodes are charac-
ter-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.
编辑于 2018-03-16