外接磁盘绝对不能使用NTFS格式分区!速度非常慢
安装测试磁盘速度的软件:
1 | sudo apt-get install hdparm |
测试本地card的读写速度:
1 | hdparm -Tt /dev/mmcblk0 |
1 | pi@raspberrypi ~ /downloads $ sudo hdparm -Tt /dev/mmcblk0 |
1 2 3 4 5 6 7 | /dev/mmcblk0: Timing cached reads: 210 MB in 2.02 seconds = 104.21 MB/sec Timing buffered disk reads: 54 MB in 3.09 seconds = 17.45 MB/sec pi@raspberrypi ~/downloads $ dd count=50 bs=1M if=/dev/zero of=~/test.img 50+0 records in 50+0 records out 52428800 bytes (52 MB) copied, 1.55218 s, 33.8 MB/s |
测试外接硬盘的读写速度:
1 | hdparm -Tt /dev/sda1 |
1 | pi@raspberrypi ~ /downloads $ sudo hdparm -Tt /dev/sda1 |
1 2 3 | /dev/sda1: Timing cached reads: 316 MB in 2.01 seconds = 157.46 MB/sec Timing buffered disk reads: 62 MB in 3.03 seconds = 20.48 MB/sec |
1 | pi@raspberrypi ~ /downloads $ dd count=50 bs=1M if = /dev/zero of= /media/usbdisk/test .img |
1 2 3 | 50+0 records in 50+0 records out 52428800 bytes (52 MB) copied, 13.5962 s, 3.9 MB/s |
将external disk 格式化成ext4
1 | sudo mount -t ext4 /dev/sda1 /media/usbdisk |
1 | pi@raspberrypi / $ sudo dd count=50 bs=1M if = /dev/zero of= /media/usbdisk/test .img |
1 2 3 | 50+0 records in 50+0 records out 52428800 bytes (52 MB) copied, 1.15549 s, 45.4 MB/s |
bingo!!