zoukankan      html  css  js  c++  java
  • Linux上使用SMART检测硬盘

    SMART(Self-Monitoring, Analysis, and Reporting Technology)是一种普及度比较高的磁盘分析检测工具,磁盘运行过程中,该工具搜集磁盘的状态参数,如型号、容量、温度、密度、扇区、寻道时间、传输、误码率等。可以做到动态检测磁盘状态,当某些参数达到阈值时,会警示磁盘故障。

    SMART包括2个工具,守护进程smartd和应用程序smartctl。守护进程用来检测、监控、分析、上报磁盘信息,有对应的配置维护。smartctl用以检查磁盘的运行状态信息。

    下面简单列举smartctrl的常用用法:

    smartctl -a #检查是否启用smart
    smartctl -s on #启用smart
    smartctl -H #检查磁盘健康状况
    smartctl -A #查看硬盘的详细信息
    smartctl -t long #后台检测,消耗时间长
    smartctl -t short #后台检测,消耗时间短
    smartctl -C -t #前台检测硬盘,CPU、内存消耗
    smartctl -X #中断后台检测硬盘
    smartctl -l selftest #显示硬盘检测日志
    smartctl -l error #显示硬盘错误汇总

    一般会在守护进程smartd中配置一些高级功能,比如,定时检测、分析汇总、上报等。可以编辑smartd.conf进行配置。常用的配置项:

    1. 邮件告警
      /dev/sda -a -m admin@example.com,root@localhost #监控磁盘的所有属性,出现 Failure,邮件通知
      /dev/sda -H -m admin@example.com,root@localhost #监控磁盘的健康状态,出现 Failure,邮件通知
      /dev/sdb -m admin@example.com -M test #启用时,发送test消息
    2. 定时检测

    /dev/sde -d hpt,1/1 -a -s S/../.././01 #每天1:00-2:00 am,进行短自检
    /dev/sde -d hpt,1/2 -a -s S/../.././02 #每天2:00-3:00 am,进行短自检
    /dev/sde -d hpt,1/3 -a -s S/../.././03 #每天3:00-4:00 am,进行短自检
    /dev/sde -d hpt,1/4/1 -a -s L/../../7/00 #每周日00:00-01:00 am,进行长自检
    /dev/sde -d hpt,1/4/2 -a -s L/../../7/02 #每周日02+00-03:00 am,进行长自检
    【参考】http://smartmontools.sourceforge.net/man/smartd.conf.5.html

  • 相关阅读:
    带横线圆圈标题
    锚点点击导航 跳转到相应位置,样式随之变化
    导航随滚动改变样式
    for循环中嵌套函数,执行顺序和结果该如何理解?
    mui 记录
    获取页面所有a标签href
    cookie记录横向滚动条位置
    Istio全景监控与拓扑
    Istio 流量治理功能原理与实战
    Cloud Native Weekly | KubeCon首登中国,华为云亮相KubeCon 2018,微软云服务又罢工
  • 原文地址:https://www.cnblogs.com/vman/p/4799230.html
Copyright © 2011-2022 走看看