用户工具

站点工具


drserver:checkdiskinformationoncentos7
no way to compare when less than two revisions

差别

这里会显示出您选择的修订版和当前版本之间的差别。


drserver:checkdiskinformationoncentos7 [2018/10/29 11:23] (当前版本) – 创建 liujia
行 1: 行 1:
 +====== 在 CentOS 7 里用 smartctl 和 hdparm 对硬盘进行基本测试 ======
  
 +新租服务器,想对硬盘的健康情况和读写速度进行基本测试,如使用 CentOS 7系统,可使用smartctl 和 hdparm 的命令。
 +
 +过程:
 +
 +1.yum -y install smartmontools hdparm # 安装相应的软件
 +
 +2.smartctl --test=short /dev/sda # 假如硬盘设备名称是 /dev/sda,进行简单测试
 +
 +{{https://alioss.anqun.org/typecho/2018/10/29/82947468669464.png}}
 +
 +3.smartctl -l selftest /dev/sda # 几分钟后,查看测试结果,如本例,关键信息是 Completed without error,无错误
 +
 +{{https://alioss.anqun.org/typecho/2018/10/29/829471420728490.png}}
 +
 +4.smartctl -H /dev/sda # 查看整体健康情况,关键信息是 SMART overall-health self-assessment test result: PASSED,测试通过
 +
 +{{https://alioss.anqun.org/typecho/2018/10/29/829472901196434.png}}
 +
 +5.hdparm -Tt /dev/sda # 测试读取速度,本例是 125.98 MB/sec
 +
 +{{https://alioss.anqun.org/typecho/2018/10/29/82947547902330.png}}
 +
 +6.dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc status=progress # 用 dd 来测试写入速度,第一次 66.6 MB/s
 +
 +7.echo 3 > /proc/sys/vm/drop_caches # 清除 buffer-cache 
 +
 +8.dd if=tempfile of=/dev/null bs=1M count=1024 status=progress # 再次测试,96.6 MB/s
 +
 +9.dd if=tempfile of=/dev/null bs=1M count=1024 status=progress # 最后一次测试,有 buffer-cache ,是 1.7 GB/s
 +
 +{{https://alioss.anqun.org/typecho/2018/10/29/829472513463575.png}}
 +
 +参考:
 +  * https://wiki.archlinux.org/index.php/Benchmarking#hdparm
 +  * https://unix.stackexchange.com/questions/363212/smartmontools-with-nvme-support-on-centos-7
 +  * https://www.server-world.info/en/note?os=CentOS_7&p=hdparm
drserver/checkdiskinformationoncentos7.txt · 最后更改: 2018/10/29 11:23 由 liujia