首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >linux smartctl 命令,在 CentOS 7 里用 smartctl 和 hdparm 对硬盘进行基本测试

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

作者头像
全栈程序员站长
发布2022-08-31 16:21:08
发布2022-08-31 16:21:08
3.2K0
举报

大家好,又见面了,我是你们的朋友全栈君。

新租服务器,想对硬盘的健康情况和读写速度进行基本测试,如使用 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://javaforall.cn/151663.html原文链接:https://javaforall.cn

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档