Linux下用dd命令测试硬盘的读写速度

一、测试写速度:

 
time dd if=/dev/zero of=/tmp/test bs=8k count=1000000

测试结果:565 MB/s

二、测试读速度:

 
time dd if=/tmp/test of=/dev/null bs=8k

测试结果:4.7GB/s

三、测试读写速度:

 
time dd if=/tmp/test of=/var/test bs=64k

测试结果:387MB/s

四、参数说明

①、time有计时作用,dd用于复制,从if读出,写到of;

②、if=/dev/zero不产生IO,因此可以用来测试纯写速度;

③、同理of=/dev/null不产生IO,可以用来测试纯读速度;

④、将/tmp/test拷贝到/var则同时测试了读写速度;

⑤、bs是每次读或写的大小,即一个块的大小,count是读写块的数量。

 

实例测试:

[root@gpu-server-003 tmp]# time dd if=/dev/zero of=/mnt2/test bs=8k count=1000000
1000000+0 records in
1000000+0 records out
8192000000 bytes (8.2 GB) copied, 5.60322 s, 1.5 GB/s

real	0m5.620s
user	0m0.078s
sys	0m5.525s
[root@gpu-server-003 tmp]# 
[root@gpu-server-003 tmp]# time dd if=/dev/zero of=/mnt/test bs=8k count=1000000
1000000+0 records in
1000000+0 records out
8192000000 bytes (8.2 GB) copied, 6.41214 s, 1.3 GB/s

real	0m6.414s
user	0m0.097s
sys	0m6.318s
[root@gpu-server-003 tmp]# 
You have new mail in /var/spool/mail/root
[root@gpu-server-003 tmp]# 
[root@gpu-server-003 tmp]# time dd if=/mnt2/test  of=/dev/null  bs=8k 
1000000+0 records in
1000000+0 records out
8192000000 bytes (8.2 GB) copied, 1.62227 s, 5.0 GB/s

real	0m1.624s
user	0m0.082s
sys	0m1.541s
[root@gpu-server-003 tmp]# 
[root@gpu-server-003 tmp]# time dd if=/mnt/test  of=/dev/null  bs=8k 
1000000+0 records in
1000000+0 records out
8192000000 bytes (8.2 GB) copied, 1.81242 s, 4.5 GB/s

real	0m1.814s
user	0m0.073s
sys	0m1.739s

  

转载于:https://www.cnblogs.com/weifeng1463/p/11024185.html

  • 0
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值