linux 磁盘IO速度测试

写入速度测试命令:time dd oflag=direct if=/dev/zero of=/data2/test bs=2k count=1000000     //if表示从哪里读取 of表示写入到哪里  bs是块的大小,count表示数量    

读取速度测试命令:time dd iflag=direct if=/data2/test of=/dev/null bs=2k                   //同理

flag:参数可选值:
append      追加模式(仅对输出有意义;隐含了conv=notrunc)
  direct         使用直接I/O 存取模式
  directory    除非是目录,否则 directory 失败
  dsync         使用同步I/O 存取模式
  sync           与上者类似,但同时也对元数据生效
  fullblock     为输入积累完整块(仅iflag)
  nonblock   使用无阻塞I/O 存取模式
  noatime     不更新存取时间
  nocache    丢弃缓存数据
  noctty         不根据文件指派控制终端
  nofollow     不跟随链接文件
人生如修仙,岂是一日间。何时登临顶,上善若水前。
原文地址:https://www.cnblogs.com/f-society/p/13631667.html