首页 > 系统服务 > 详细

linux dd 读取 写入磁盘速度

时间:2016-06-23 01:08:13      阅读:253      评论:0      收藏:0      [点我收藏+]

time有计时作用,dd用于复制,从if读出,写到of。if=/dev/zero不产生IO,因此可以用来测试纯写速度。同理of=/dev/null不产生IO,可以用来测试纯读速度。bs是每次读或写


的大小,即一个块的大小,count是读写块的数量。



指定出读取,写入文件到硬盘的速度


1.测/目录所在磁盘的纯写速度:


[root@base-dmz1 /]# time dd if=/dev/zero bs=1024 count=1000000 of=/1Gb.file

1000000+0 records in

1000000+0 records out

1024000000 bytes (1.0 GB) copied, 2.57314 seconds, 398 MB/s


real    0m2.787s

user    0m0.920s

sys     0m1.867s



以上是因为使用了time才显示的,linux5中不需要使用,在linux4中是不会有(1024000000 bytes (1.0 GB) copied, 2.57314 seconds, 398 MB/s)部分,因此需要time命令来计


算复制的时间。


2.测/目录所在磁盘的纯读速度:


dd if=/kvm/ftp/other/1Gb.file bs=64k |dd of=/dev/null

382860+0 records in

382860+0 records out

3136389120 bytes (3.1 GB) copied, 68.38 seconds, 45.9 MB/s


real    1m8.406s

user    0m0.039s

sys     0m4.573s


3.测读写速度(这是什么):


dd if=/vat/test of=/oradata/test1 bs=64k

dd: writing `/oradata/test1‘: No space left on device

5025+0 records in

5024+0 records out

329261056 bytes (329 MB) copied, 23.8813 seconds, 13.8 MB/s


注:理论上复制量越大测试越准确。



2010-07-05


本文出自 “五片棱角” 博客,请务必保留此出处http://hi289.blog.51cto.com/4513812/1791945

linux dd 读取 写入磁盘速度

原文:http://hi289.blog.51cto.com/4513812/1791945

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!