smartctl -i /dev/hdb
例如看到如下返回结果
[[email protected] ~]# smartctl -i /dev/hdb
smartctl version 5.33 [i386-redhat-linux-gnu] Copyright (C) 2002-4 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
=== START OF INFORMATION SECTION ===
Device Model: ST380011A
Serial Number: 3JVAPRGH
Firmware Version: 3.04
User Capacity: 80,026,361,856 bytes
Device is: In smartctl database [for details use: -P show]
ATA Version is: 6
ATA Standard is: ATA/ATAPI-6 T13 1410D revision 2
Local Time is: Tue Apr 3 15:39:52 2007 CST
SMART support is: Available - device has SMART capability.
SMART support is: Disabled
SMART Disabled. Use option -s with argument 'on' to enable it.
[[email protected] ~]#
我们可以看到SMART support is: Disabled表示SMART未启用
smartctl --smart=on --offlineauto=on --saveauto=on /dev/hdb
例如看到如下返回结果
[[email protected] ~]# smartctl --smart=on --offlineauto=on --saveauto=on /dev/hdb
smartctl version 5.33 [i386-redhat-linux-gnu] Copyright (C) 2002-4 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
=== START OF ENABLE/DISABLE COMMANDS SECTION ===
SMART Enabled.
SMART Attribute Autosave Enabled.
SMART Automatic Offline Testing Enabled every four hours.
现在硬盘的SMART功能已经被打开
smartctl -H /dev/hda
例如可以看到如下结果:
[[email protected] ~]# smartctl -H /dev/hdb
smartctl version 5.33 [i386-redhat-linux-gnu] Copyright (C) 2002-4 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
请注意result后边的结果:PASSED,这表示硬盘健康状态良好
smartctl -A /dev/hdb
例如可以看到如下结果:
[[email protected] ~]# smartctl -A /dev/hdb
smartctl version 5.33 [i386-redhat-linux-gnu] Copyright (C) 2002-4 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000f 053 051 006 Pre-fail Always - 11338710
3 Spin_Up_Time 0x0003 098 097 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 17
5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 0
7 Seek_Error_Rate 0x000f 087 060 030 Pre-fail Always - 610059516
9 Power_On_Hours 0x0032 087 087 000 Old_age Always - 11974
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 110
194 Temperature_Celsius 0x0022 045 052 000 Old_age Always - 45
195 Hardware_ECC_Recovered 0x001a 053 051 000 Old_age Always - 11338710
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0000 100 253 000 Old_age Offline - 0
202 TA_Increase_Count 0x0032 100 253 000 Old_age Always - 0
上边列出的参数表中可供进行技术分析和参考,使用下边的命令可以输出完整结果:
smartctl -a /dev/hdb
vi /etc/smartd.conf
这个配置文件中大部分可能是注释掉的说明,只需要和当前硬盘相关的一行写入正确即可:
/dev/hdb -H -m [email protected]
上边的配置表示smartd以静默状态工作,当SMART中报告PASSED的时候不理睬,一旦出现Failure,立刻用邮件通知用户指定的邮箱。
/etc/init.d/smartd
即可完成对SMART的全部配置。