技术开发 频道

使用smartmontools监控磁盘的健康状态

  其它一些有用的参数

  -A 显示支持的SMART属性,参考命令:

#smartctl -A sda

  返回内容:  

smartctl version 5.38 [i686-mingw32-xp-sp2] Copyright (C) 2002-8 Bruce Allen

  Home page
is http://smartmontools.sourceforge.net/

  
=== START OF READ SMART DATA SECTION ===

  SMART Attributes Data Structure revision
number: 16

  Vendor Specific SMART Attributes
with Thresholds:

  ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE

  
3 Spin_Up_Time 0x0027 220 220 063 Pre-fail Always - 13621

  
4 Start_Stop_Count 0x0032 253 253 000 Old_age Always - 999

  
5 Reallocated_Sector_Ct 0x0033 253 253 063 Pre-fail Always - 0

  
6 Read_Channel_Margin 0x0001 253 253 100 Pre-fail Offline - 0

  
7 Seek_Error_Rate 0x000a 253 252 000 Old_age Always - 0

  
8 Seek_Time_Performance 0x0027 250 241 187 Pre-fail Always - 59017

  
9 Power_On_Minutes 0x0032 225 225 000 Old_age Always - 1019h+16m

  
10 Spin_Retry_Count 0x002b 253 252 157 Pre-fail Always - 0

  
11 Calibration_Retry_Count 0x002b 253 252 223 Pre-fail Always - 0

  
12 Power_Cycle_Count 0x0032 251 251 000 Old_age Always - 1091

  
192 Power-Off_Retract_Count 0x0032 253 253 000 Old_age Always - 0

  
193 Load_Cycle_Count 0x0032 253 253 000 Old_age Always - 0

  
194 Temperature_Celsius 0x0032 253 253 000 Old_age Always - 39

  
195 Hardware_ECC_Recovered 0x000a 253 252 000 Old_age Always - 1566

  
196 Reallocated_Event_Count 0x0008 253 253 000 Old_age Offline - 0

  
197 Current_Pending_Sector 0x0008 253 253 000 Old_age Offline - 0

  
198 Offline_Uncorrectable 0x0008 253 253 000 Old_age Offline - 0

  
199 UDMA_CRC_Error_Count 0x0008 199 199 000 Old_age Offline - 0

  
200 Multi_Zone_Error_Rate 0x000a 253 252 000 Old_age Always - 0

  
201 Soft_Read_Error_Rate 0x000a 253 251 000 Old_age Always - 5

  
202 TA_Increase_Count 0x000a 253 252 000 Old_age Always - 0

  
203 Run_Out_Cancel 0x000b 253 252 180 Pre-fail Always - 0

  
204 Shock_Count_Write_Opern 0x000a 253 252 000 Old_age Always - 0

  
205 Shock_Rate_Write_Opern 0x000a 253 252 000 Old_age Always - 0

  
207 Spin_High_Current 0x002a 253 252 000 Old_age Always - 0

  
208 Spin_Buzz 0x002a 253 252 000 Old_age Always - 0

  
209 Offline_Seek_Performnce 0x0024 189 187 000 Old_age Offline - 0

  
99 Unknown_Attribute 0x0004 253 253 000 Old_age Offline - 0

  
100 Unknown_Attribute 0x0004 253 253 000 Old_age Offline - 0

  
101 Unknown_Attribute 0x0004 253 253 000 Old_age Offline - 0

  返回结果中的id#为194的属性(Temperature_Celsius)表示输出硬盘温度,所以才会有软件能够监测到硬盘的温度。我们从这里也可以直接看到硬盘当前的温度为39°C,理想的状态是控制在5°C左右,所以应该增加风扇了。

  -a 显示设备所有的SMART信息。

  -l error 列出硬盘错误日志。如果显示没有错误最好,如果显示了大量的错误信息,那就该着手准备替换硬盘了。

  -l selftest 列出自行测试结果。

  利用smartd进行自动监控

  smartd是smartmontools软件包中的一个实用程序,可以单独运行,也可以注册为系统服务,Windows上的注册命令为:

>smartd install

  注册后,打开services.msc,可看到一个名叫“SmartD Service”服务,并设置为“自动”启动。

  在非Windows平台上可通过向/etc/rc.d/init.d添加smartd脚本,其实在安装smartmontools软件包的时候通常会安装到这个位置,只需要在对应的启动级别下做一个软链接就可以了。

  smartd的配置文件为smartd.conf(Windows和非Windows平台都叫这个名字,Windows平台与smartd.exe在同一个目录下,非Windows平台位于/etc目录下),在这个配置文件中已经内置许多种监视方法和参数说明,值得一体的是-m参数,可以利用它将监视报告以邮件的形式发送给指定的E-mail地址,这样设备管理员就可以坐在电脑前就可以掌控所有硬盘设备的健康状况了。

0
相关文章