开发者社区> 问答> 正文

在 CentOS 7 里用 smartctl 和 hdparm 对硬盘进行基本测试

新租服务器,想对硬盘的健康情况和读写速度进行基本测试,如使用 CentOS 7系统,可使用smartctl 和 hdparm 的命令。


过程:


1.yum -y install smartmontools hdparm # 安装相应的软件


2.smartctl --test=short /dev/sda # 假如硬盘设备名称是 /dev/sda,进行简单测试



3.smartctl -l selftest /dev/sda # 几分钟后,查看测试结果,如本例,关键信息是 Completed without error,无错误



4.smartctl -H /dev/sda # 查看整体健康情况,关键信息是 SMART overall-health self-assessment test result: PASSED,测试通过



5.hdparm -Tt /dev/sda # 测试读取速度,本例是 125.98 MB/sec



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://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

展开
收起
dongshan8 2018-11-23 14:19:22 3682 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
移动互联网测试到质量的转变 立即下载
给ITer的技术实战进阶课-阿里CIO学院独家教材(四) 立即下载
F2etest — 多浏览器兼容性测试整体解决方案 立即下载