树莓派

查看磁盘

$ parted -l
$ fdisk -l

安装HFS+文件系统工具

$ apt-get install hfsplus hfsutils hfsprogs

格式化磁盘

$ mkfs.hfsplus -v "SDA1" /dev/sda1

磁盘读写速度

测试写入速度:(加上oflag=direct才是实际速度)

$ time dd if=/dev/zero of=test.dd bs=1024k count=100 oflag=direct

测试读取速度:

$ dd if=test.dd bs=1024k count=100 of=/dev/null

测试结果

树莓派MicSD:写入 9 MB/s,读取 18.9 MB/s

$ time dd if=/dev/zero of=test.dd bs=1024k count=100 oflag=direct
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 11.7067 s, 9.0 MB/s

real	0m11.716s
user	0m0.000s
sys	0m0.150s

$ dd if=test.dd bs=1024k count=100 of=/dev/null
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 5.55338 s, 18.9 MB/s

外接USB硬盘(HFS+格式)很可怜:写入 507 kB/s,读取 509 kB/s(速度瓶颈应该是在硬盘壳上面,可能是USB2.0的问题)

$ time dd if=/dev/zero of=test.dd bs=1024k count=100 oflag=direct
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 206.776 s, 507 kB/s

real	3m26.791s
user	0m0.000s
sys	0m0.190s

$ dd if=test.dd bs=1024k count=100 of=/dev/null
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 205.881 s, 509 kB/s

ps: SSD W:346 MB/s R:273 MB/s USB-HDD W:67.3 MB/s R:58.6 MB/s