Llinux下通过命令测硬盘读写速度
dd 的主要选项:
if=file #输入文件名,缺省为标准输入。
of=file #输出文件名,缺省为标准输出。
ibs=bytes #一次读入 bytes 个字节(即一个块大小为 bytes 个字节)。
obs=bytes #一次写 bytes 个字节(即一个块大小为 bytes 个字节)。
bs=bytes #同时设置读写块的大小为 bytes ,可代替 ibs 和 obs 。
cbs=bytes #一次转换 bytes 个字节,即转换缓冲区大小。
skip=blocks #从输入文件开头跳过 blocks 个块后再开始复制。
seek=blocks #从输出文件开头跳过 blocks 个块后再开始复制。(通常只有当输出文件是磁盘或磁带时才有效)。
count=blocks #仅拷贝 blocks 个块,块大小等于 ibs 指定的字节数。
conv=conversion[,conversion…] #用指定的参数转换文件。
1.vmWare下通过安装的deepin
写测试
chenqian@chenqian-PC:~$ time dd if=/dev/zero bs=1024 count=1000000 of=./1GB.file
记录了1000000+0 的读入
记录了1000000+0 的写出
1024000000 bytes (1.0 GB, 977 MiB) copied, 6.88879 s, 149 MB/s
real 0m6.891s
user 0m0.188s
sys 0m5.112s
读测试
chenqian@chenqian-PC:~/myShell$ time dd if=./1GB.file bs=1024 count=1000000 of=/dev/null
记录了1000000+0 的读入
记录了1000000+0 的写出
1024000000 bytes (1.0 GB, 977 MiB) copied, 0.541287 s, 1.9 GB/s
real 0m0.543s
user 0m0.004s
sys 0m0.520s
2.3399开发板测试,自带存储
[root@rockchip:/]# time dd if=/dev/zero bs=1024 count=1000000 of=./1GB.file
1000000+0 records in
1000000+0 records out
real 0m 14.63s
user 0m 0.55s
sys 0m 7.83s
[root@rockchip:/]# ls -alh 1GB.file
-rw-r--r-- 1 root root 976.6M Jan 18 08:57 1GB.file
写速度为977/14.63=66.7805MB/s
[root@rockchip:/]# time dd if=./1GB.file bs=1024 count=1000000 of=dev/null
1000000+0 records in
1000000+0 records out
real 0m 1.37s
user 0m 0.26s
sys 0m 1.10s
读速度为977/1.37=713.138MB/s
3.RK3399采用的是Emmc存储,速度大大会低于pc
4.hdparm命令测试
sudo apt-get install hdparm