测试Linux服务器SCSI/SATA硬盘是否正常

来源:互联网 发布:java扑克牌程序 编辑:程序博客网 时间:2024/05/16 08:12

http://blog.csdn.net/simon_xia_uestc/article/details/11520075

原文链接:Test If Linux Server SCSI / SATA Hard Disk Going Bad

    我们读者中的一个常客提到一个问题:

    怎么测试我的硬盘是否出故障?我在 /var/log/messages 文件中只能看到很少的错误

    /var/log/messages 文件中的 I/O 错误表明硬盘出了一些故障甚至可能是挂掉。可以使用 smartctl 命令查看硬盘故障,这是Linux/Unix 类操作系统下对 SMART 硬盘的控制和监视工具。

    smartctl 基于硬盘自检、分析和报告技术(SMART),该技术内置到很多 ATA-3(及其后来版本)、IDE、SCSI-3 硬盘驱动中。SMART的作用在与监测硬盘的可靠性和预测错误,同时展开不同类型的驱动自检。


服务器smartctl

smartctl 是一个命令行工具,旨在执行SMART任务比如:显示SMART自检和错误日志,启用和禁用SMART自动检测,开始设备自我测试。首先,确认BIOS中允许SMART支持。然后,运行如下命令查看你的硬盘是否支持SMART技术。

[plain] view plaincopy
  1. # smartctl -i /dev/sdb  

启用 SMART,运行

[html] view plaincopy
  1.   
[plain] view plaincopy
  1. # smartctl -s on -d ata /dev/sdb  

样例输出:

[plain] view plaincopy
  1. smartctl version 5.33 [x86_64-redhat-linux-gnu] Copyright (C) 2002-4 Bruce Allen  
  2. Home page is http://smartmontools.sourceforge.net/  
  3. === START OF ENABLE/DISABLE COMMANDS SECTION ===  
  4. SMART Enabled.  
运行整体状况和自我评价测试,输入

[plain] view plaincopy
  1. # smartctl -d ata -H /dev/sdb  

样例输出:

[plain] view plaincopy
  1. smartctl version 5.33 [x86_64-redhat-linux-gnu] Copyright (C) 2002-4 Bruce Allen  
  2. Home page is http://smartmontools.sourceforge.net/  
  3. === START OF READ SMART DATA SECTION ===  
  4. SMART overall-health self-assessment test result: PASSED  
一个不合格的硬盘输出样例:

[plain] view plaincopy
  1. smartctl version 5.38 [i686-pc-linux-gnu] Copyright (C) 2002-8 Bruce Allen  
  2. Home page is http://smartmontools.sourceforge.net/  
  3. === START OF READ SMART DATA SECTION ===  
  4. SMART overall-health self-assessment test result: PASSED  
  5. Please note the following marginal Attributes:  
  6. ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE  
  7. 190 Airflow_Temperature_Cel 0x0022   044   033   045    Old_age   Always   FAILING_NOW 56 (96 110 58 25)  
下面的命令会对不合格的硬盘提供更多详细的信息:

[plain] view plaincopy
  1. # smartctl --attributes --log=selftest /dev/sda  
样例输出:

[plain] view plaincopy
  1. smartctl version 5.38 [i686-pc-linux-gnu] Copyright (C) 2002-8 Bruce Allen  
  2. Home page is http://smartmontools.sourceforge.net/  
  3. === START OF READ SMART DATA SECTION ===  
  4. SMART Attributes Data Structure revision number: 10  
  5. Vendor Specific SMART Attributes with Thresholds:  
  6. ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE  
  7.   1 Raw_Read_Error_Rate     0x000f   098   092   006    Pre-fail  Always       -       238320363  
  8.   3 Spin_Up_Time            0x0003   100   100   000    Pre-fail  Always       -       0  
  9.   4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       587  
  10.   5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       9  
  11.   7 Seek_Error_Rate         0x000f   077   060   030    Pre-fail  Always       -       51672328  
  12.   9 Power_On_Hours          0x0032   095   095   000    Old_age   Always       -       4805  
  13.  10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0  
  14.  12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       586  
  15. 184 Unknown_Attribute       0x0032   100   100   099    Old_age   Always       -       0  
  16. 187 Reported_Uncorrect      0x0032   001   001   000    Old_age   Always       -       417  
  17. 188 Unknown_Attribute       0x0032   100   099   000    Old_age   Always       -       4295032833  
  18. 189 High_Fly_Writes         0x003a   094   094   000    Old_age   Always       -       6  
  19. 190 Airflow_Temperature_Cel 0x0022   044   033   045    Old_age   Always   FAILING_NOW 56 (96 122 58 25)  
  20. 194 Temperature_Celsius     0x0022   056   067   000    Old_age   Always       -       56 (0 23 0 0)  
  21. 195 Hardware_ECC_Recovered  0x001a   043   026   000    Old_age   Always       -       238320363  
  22. 197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       49  
  23. 198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       49  
  24. 199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0  
  25. 240 Head_Flying_Hours       0x0000   100   253   000    Old_age   Offline      -       172082159686339  
  26. 241 Unknown_Attribute       0x0000   100   253   000    Old_age   Offline      -       2155546016  
  27. 242 Unknown_Attribute       0x0000   100   253   000    Old_age   Offline      -       3048586928  
  28. SMART Self-test log structure revision number 1  
  29. Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error  
  30. # 1  Extended offline    Completed: read failure       90%      4789         1746972641  


通过输入下面这条命令,你可以获得更多数据:

[plain] view plaincopy
  1. # smartctl -d ata -a /dev/sdb  
输出:

[plain] view plaincopy
  1. smartctl version 5.33 [x86_64-redhat-linux-gnu] Copyright (C) 2002-4 Bruce Allen  
  2. Home page is http://smartmontools.sourceforge.net/  
  3. === START OF INFORMATION SECTION ===  
  4. Device Model:     WDC WD2500YS-01SHB0  
  5. Serial Number:    WD-WCANY1729333  
  6. Firmware Version: 20.06C03  
  7. User Capacity:    251,000,193,024 bytes  
  8. Device is:        Not in smartctl database [for details use: -P showall]  
  9. ATA Version is:   7  
  10. ATA Standard is:  Exact ATA specification draft version not indicated  
  11. Local Time is:    Wed Jul  4 15:04:38 2007 CDT  
  12. SMART support is: Available - device has SMART capability.  
  13. SMART support is: Enabled  
  14. === START OF READ SMART DATA SECTION ===  
  15. SMART overall-health self-assessment test result: PASSED  
  16. General SMART Values:  
  17. Offline data collection status:  (0x82) Offline data collection activity  
  18.                                         was completed without error.  
  19.                                         Auto Offline Data Collection: Enabled.  
  20. Self-test execution status:      (   0) The previous self-test routine completed  
  21.                                         without error or no self-test has ever  
  22.                                         been run.  
  23. Total time to complete Offline  
  24. data collection:                 (7800) seconds.  
  25. Offline data collection  
  26. capabilities:                    (0x7b) SMART execute Offline immediate.  
  27.                                         Auto Offline data collection on/off support.  
  28.                                         Suspend Offline collection upon new  
  29.                                         command.  
  30.                                         Offline surface scan supported.  
  31.                                         Self-test supported.  
  32.                                         Conveyance Self-test supported.  
  33.                                         Selective Self-test supported.  
  34. SMART capabilities:            (0x0003) Saves SMART data before entering  
  35.                                         power-saving mode.  
  36.                                         Supports SMART auto save timer.  
  37. Error logging capability:        (0x01) Error logging supported.  
  38.                                         General Purpose Logging supported.  
  39. Short self-test routine  
  40. recommended polling time:        (   2) minutes.  
  41. Extended self-test routine  
  42. recommended polling time:        (  92) minutes.  
  43. Conveyance self-test routine  
  44. recommended polling time:        (   6) minutes.  
  45. SMART Attributes Data Structure revision number: 16  
  46. Vendor Specific SMART Attributes with Thresholds:  
  47. ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE  
  48.   1 Raw_Read_Error_Rate     0x000f   200   200   051    Pre-fail  Always       -       0  
  49.   3 Spin_Up_Time            0x0003   190   187   021    Pre-fail  Always       -       5500  
  50.   4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       24  
  51.   5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0  
  52.   7 Seek_Error_Rate         0x000f   200   200   051    Pre-fail  Always       -       0  
  53.   9 Power_On_Hours          0x0032   092   092   000    Old_age   Always       -       6382  
  54.  10 Spin_Retry_Count        0x0013   100   253   051    Pre-fail  Always       -       0  
  55.  11 Calibration_Retry_Count 0x0013   100   253   051    Pre-fail  Always       -       0  
  56.  12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       23  
  57. 194 Temperature_Celsius     0x0022   127   096   000    Old_age   Always       -       23  
  58. 196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0  
  59. 197 Current_Pending_Sector  0x0012   200   200   000    Old_age   Always       -       0  
  60. 198 Offline_Uncorrectable   0x0010   200   200   000    Old_age   Offline      -       0  
  61. 199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0  
  62. 200 Multi_Zone_Error_Rate   0x0009   200   200   051    Pre-fail  Offline      -       0  
  63. SMART Error Log Version: 1  
  64. No Errors Logged  
  65. SMART Self-test log structure revision number 1  
  66. No self-tests have been logged.  [To run self-tests, use: smartctl -t]  
  67. SMART Selective self-test log data structure revision number 1  
  68.  SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS  
  69.     1        0        0  Not_testing  
  70.     2        0        0  Not_testing  
  71.     3        0        0  Not_testing  
  72.     4        0        0  Not_testing  
  73.     5        0        0  Not_testing  
  74. Selective self-test flags (0x0):  
  75.   After scanning selected spans, do NOT read-scan remainder of disk.  
  76. If Selective self-test is pending on power-up, resume after 0 minute delay.  


RAID(磁盘阵列)控制器注意事项

查看 3ware SCSI RAID 控制器背后的的ATA硬盘语法是:

[plain] view plaincopy
  1. # smartctl -a -d 3ware,2 /dev/sda  
  2. # smartctl -a -d 3ware,0 /dev/twe0  

了解如何使用 smartctl 命令查看 Adaptec RAID 和 3ware SCSI RAID 背后的硬盘以获得更多信息

任务:硬盘的扩展自检

你需要对 /dev/hdc 开始一个扩展的硬盘自检。你可以在一个运行的系统上执行这个命令。结果将会在自检日志中看到,当然是用'-l selftest'选项设置可见时。

[plain] view plaincopy
  1. # smartctl -d ata -t long /dev/sdb  

损坏硬盘的细节报告样例:

[plain] view plaincopy
  1. # smartctl -a /dev/sda  

样例输出:

[plain] view plaincopy
  1. smartctl version 5.38 [i686-pc-linux-gnu] Copyright (C) 2002-8 Bruce Allen  
  2. Home page is http://smartmontools.sourceforge.net/  
  3. === START OF INFORMATION SECTION ===  
  4. Device Model:     ST31500341AS  
  5. Serial Number:    9VS0TG4B  
  6. Firmware Version: CC1H  
  7. User Capacity:    1,500,301,910,016 bytes  
  8. Device is:        Not in smartctl database [for details use: -P showall]  
  9. ATA Version is:   8  
  10. ATA Standard is:  ATA-8-ACS revision 4  
  11. Local Time is:    Mon Oct 26 21:16:15 2009 IST  
  12. SMART support is: Available - device has SMART capability.  
  13. SMART support is: Enabled  
  14. === START OF READ SMART DATA SECTION ===  
  15. SMART overall-health self-assessment test result: PASSED  
  16. See vendor-specific Attribute list for marginal Attributes.  
  17. General SMART Values:  
  18. Offline data collection status:  (0x82) Offline data collection activity  
  19.                     was completed without error.  
  20.                     Auto Offline Data Collection: Enabled.  
  21. Self-test execution status:      (   0) The previous self-test routine completed  
  22.                     without error or no self-test has ever  
  23.                     been run.  
  24. Total time to complete Offline  
  25. data collection:         ( 617) seconds.  
  26. Offline data collection  
  27. capabilities:            (0x7b) SMART execute Offline immediate.  
  28.                     Auto Offline data collection on/off support.  
  29.                     Suspend Offline collection upon new  
  30.                     command.  
  31.                     Offline surface scan supported.  
  32.                     Self-test supported.  
  33.                     Conveyance Self-test supported.  
  34.                     Selective Self-test supported.  
  35. SMART capabilities:            (0x0003) Saves SMART data before entering  
  36.                     power-saving mode.  
  37.                     Supports SMART auto save timer.  
  38. Error logging capability:        (0x01) Error logging supported.  
  39.                     General Purpose Logging supported.  
  40. Short self-test routine  
  41. recommended polling time:    (   1) minutes.  
  42. Extended self-test routine  
  43. recommended polling time:    ( 255) minutes.  
  44. Conveyance self-test routine  
  45. recommended polling time:    (   2) minutes.  
  46. SCT capabilities:          (0x103f) SCT Status supported.  
  47.                     SCT Feature Control supported.  
  48.                     SCT Data Table supported.  
  49. SMART Attributes Data Structure revision number: 10  
  50. Vendor Specific SMART Attributes with Thresholds:  
  51. ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE  
  52.   1 Raw_Read_Error_Rate     0x000f   098   092   006    Pre-fail  Always       -       238338845  
  53.   3 Spin_Up_Time            0x0003   100   100   000    Pre-fail  Always       -       0  
  54.   4 Start_Stop_Count        0x0032   100   100   020    Old_age   Always       -       587  
  55.   5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       9  
  56.   7 Seek_Error_Rate         0x000f   077   060   030    Pre-fail  Always       -       51672525  
  57.   9 Power_On_Hours          0x0032   095   095   000    Old_age   Always       -       4806  
  58.  10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0  
  59.  12 Power_Cycle_Count       0x0032   100   100   020    Old_age   Always       -       586  
  60. 184 Unknown_Attribute       0x0032   100   100   099    Old_age   Always       -       0  
  61. 187 Reported_Uncorrect      0x0032   001   001   000    Old_age   Always       -       417  
  62. 188 Unknown_Attribute       0x0032   100   099   000    Old_age   Always       -       4295032833  
  63. 189 High_Fly_Writes         0x003a   094   094   000    Old_age   Always       -       6  
  64. 190 Airflow_Temperature_Cel 0x0022   044   033   045    Old_age   Always   FAILING_NOW 56 (96 126 58 25)  
  65. 194 Temperature_Celsius     0x0022   056   067   000    Old_age   Always       -       56 (0 23 0 0)  
  66. 195 Hardware_ECC_Recovered  0x001a   043   026   000    Old_age   Always       -       238338845  
  67. 197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       49  
  68. 198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       49  
  69. 199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0  
  70. 240 Head_Flying_Hours       0x0000   100   253   000    Old_age   Offline      -       107168023974595  
  71. 241 Unknown_Attribute       0x0000   100   253   000    Old_age   Offline      -       2155546480  
  72. 242 Unknown_Attribute       0x0000   100   253   000    Old_age   Offline      -       3048590512  
  73. SMART Error Log Version: 1  
  74. ATA Error Count: 416 (device log contains only the most recent five errors)  
  75.     CR = Command Register [HEX]  
  76.     FR = Features Register [HEX]  
  77.     SC = Sector Count Register [HEX]  
  78.     SN = Sector Number Register [HEX]  
  79.     CL = Cylinder Low Register [HEX]  
  80.     CH = Cylinder High Register [HEX]  
  81.     DH = Device/Head Register [HEX]  
  82.     DC = Device Command Register [HEX]  
  83.     ER = Error register [HEX]  
  84.     ST = Status register [HEX]  
  85. Powered_Up_Time is measured from power on, and printed as  
  86. DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,  
  87. SS=sec, and sss=millisec. It "wraps" after 49.710 days.  
  88. Error 416 occurred at disk power-on lifetime: 4786 hours (199 days + 10 hours)  
  89.   When the command that caused the error occurred, the device was active or idle.  
  90.   After command completion occurred, registers were:  
  91.   ER ST SC SN CL CH DH  
  92.   -- -- -- -- -- -- --  
  93.   40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455  
  94.   Commands leading to the command that caused the error were:  
  95.   CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name  
  96.   -- -- -- -- -- -- -- --  ----------------  --------------------  
  97.   25 00 08 ff ff ff ef 00      00:55:03.917  READ DMA EXT  
  98.   27 00 00 00 00 00 e0 00      00:55:03.818  READ NATIVE MAX ADDRESS EXT  
  99.   ec 00 00 00 00 00 a0 00      00:55:03.798  IDENTIFY DEVICE  
  100.   ef 03 46 00 00 00 a0 00      00:55:03.779  SET FEATURES [Set transfer mode]  
  101.   27 00 00 00 00 00 e0 00      00:55:03.658  READ NATIVE MAX ADDRESS EXT  
  102. Error 415 occurred at disk power-on lifetime: 4786 hours (199 days + 10 hours)  
  103.   When the command that caused the error occurred, the device was active or idle.  
  104.   After command completion occurred, registers were:  
  105.   ER ST SC SN CL CH DH  
  106.   -- -- -- -- -- -- --  
  107.   40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455  
  108.   Commands leading to the command that caused the error were:  
  109.   CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name  
  110.   -- -- -- -- -- -- -- --  ----------------  --------------------  
  111.   25 00 08 ff ff ff ef 00      00:55:00.927  READ DMA EXT  
  112.   27 00 00 00 00 00 e0 00      00:55:00.837  READ NATIVE MAX ADDRESS EXT  
  113.   ec 00 00 00 00 00 a0 00      00:55:00.817  IDENTIFY DEVICE  
  114.   ef 03 46 00 00 00 a0 00      00:55:00.800  SET FEATURES [Set transfer mode]  
  115.   27 00 00 00 00 00 e0 00      00:55:00.747  READ NATIVE MAX ADDRESS EXT  
  116. Error 414 occurred at disk power-on lifetime: 4786 hours (199 days + 10 hours)  
  117.   When the command that caused the error occurred, the device was active or idle.  
  118.   After command completion occurred, registers were:  
  119.   ER ST SC SN CL CH DH  
  120.   -- -- -- -- -- -- --  
  121.   40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455  
  122.   Commands leading to the command that caused the error were:  
  123.   CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name  
  124.   -- -- -- -- -- -- -- --  ----------------  --------------------  
  125.   25 00 08 ff ff ff ef 00      00:54:57.903  READ DMA EXT  
  126.   27 00 00 00 00 00 e0 00      00:54:57.807  READ NATIVE MAX ADDRESS EXT  
  127.   ec 00 00 00 00 00 a0 00      00:54:57.787  IDENTIFY DEVICE  
  128.   ef 03 46 00 00 00 a0 00      00:54:57.757  SET FEATURES [Set transfer mode]  
  129.   27 00 00 00 00 00 e0 00      00:54:57.637  READ NATIVE MAX ADDRESS EXT  
  130. Error 413 occurred at disk power-on lifetime: 4786 hours (199 days + 10 hours)  
  131.   When the command that caused the error occurred, the device was active or idle.  
  132.   After command completion occurred, registers were:  
  133.   ER ST SC SN CL CH DH  
  134.   -- -- -- -- -- -- --  
  135.   40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455  
  136.   Commands leading to the command that caused the error were:  
  137.   CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name  
  138.   -- -- -- -- -- -- -- --  ----------------  --------------------  
  139.   25 00 08 ff ff ff ef 00      00:54:54.862  READ DMA EXT  
  140.   27 00 00 00 00 00 e0 00      00:54:54.767  READ NATIVE MAX ADDRESS EXT  
  141.   ec 00 00 00 00 00 a0 00      00:54:54.746  IDENTIFY DEVICE  
  142.   ef 03 46 00 00 00 a0 00      00:54:54.728  SET FEATURES [Set transfer mode]  
  143.   27 00 00 00 00 00 e0 00      00:54:54.677  READ NATIVE MAX ADDRESS EXT  
  144. Error 412 occurred at disk power-on lifetime: 4786 hours (199 days + 10 hours)  
  145.   When the command that caused the error occurred, the device was active or idle.  
  146.   After command completion occurred, registers were:  
  147.   ER ST SC SN CL CH DH  
  148.   -- -- -- -- -- -- --  
  149.   40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455  
  150.   Commands leading to the command that caused the error were:  
  151.   CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name  
  152.   -- -- -- -- -- -- -- --  ----------------  --------------------  
  153.   25 00 08 ff ff ff ef 00      00:54:51.838  READ DMA EXT  
  154.   27 00 00 00 00 00 e0 00      00:54:51.736  READ NATIVE MAX ADDRESS EXT  
  155.   ec 00 00 00 00 00 a0 00      00:54:51.716  IDENTIFY DEVICE  
  156.   ef 03 46 00 00 00 a0 00      00:54:51.685  SET FEATURES [Set transfer mode]  
  157.   27 00 00 00 00 00 e0 00      00:54:51.566  READ NATIVE MAX ADDRESS EXT  
  158. SMART Self-test log structure revision number 1  
  159. Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error  
  160. # 1  Extended offline    Completed: read failure       90%      4789         1746972641  
  161. SMART Selective self-test log data structure revision number 1  
  162.  SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS  
  163.     1        0        0  Not_testing  
  164.     2        0        0  Not_testing  
  165.     3        0        0  Not_testing  
  166.     4        0        0  Not_testing  
  167.     5        0        0  Not_testing  
  168. Selective self-test flags (0x0):  
  169.   After scanning selected spans, do NOT read-scan remainder of disk.  
  170. If Selective self-test is pending on power-up, resume after 0 minute delay.  

从备份中恢复

如果其中一个测试报告错误,更换硬盘并且将数据从备份中恢复

在服务器上安装 smartd 来接收发现问题时的警告邮件

smartd 是一个监测硬盘的守护进程,并且它会试图启用SMART 监测硬盘。它会每隔30分钟(可配置选项)检测硬盘的健康数据和SCSI设备。它通过 SYSLOG界面记录SMART错误和属性。 这些SYSLOG通知和警告的默认位置是依赖于系统的(通常是 /var/log/messages或 /var/log/syslog)。smartd除了记录到一个文件中,也可以被配置为检测到错误时发送电子邮件警告。基于错误的不同类型,你可能需要运行盘上的自检程序,备份磁盘,更换硬盘或者使用制造商的程序,迫使坏或无法读取磁盘扇区的重新分配。更多内容请查看安装和配置smartd

Gnome 磁盘实用工具

大多数类unix系统比如FreeBSD、OpenBSD 都附带有叫做磁盘的图形工具。它只会在你运行带有gnome的台式和笔记本系统时才工作。访问磁盘工具:

[plain] view plaincopy
  1. Applications > System Tools > Disk Utility  

点击硬盘:




点击smart data 查看详情:


一个健康硬盘的例子:



问候 GSmartControl

GSmartControll是一个硬盘健康视察工具,是 smartctl命令的图形界面。有如下特点:

1、自动报告并且高亮所有异常情况;

2、可以启用/禁用 SMART;

3、允许启用/禁用自动离线数据采集 --- 驱动器将每4小时执行一个简短的自检程序并不对性能产生影响;

4、只是对 smartctl 的全局和每个驱动选项的配置

5、显示 SMART 自检

6、显示驱动器特性信息:容量、属性和自检日志

7、可以从一个保存文件中读出 smartctl的输出,并把它解释为一个虚拟设备

8、能在大多数支持smartctl的操作系统上工作,如* BSD和Linux的各种发行版

9、有海量的帮助信息


在Debian或Ubuntu你可以使用apt-get命令如下安装:

[plain] view plaincopy
  1. $ sudo apt-get install gsmartcontrol  
在Fedora、CentOS或Real中用yum命令效果相同:

[plain] view plaincopy
  1. # yum install gsmartcontrol  

样例输出:


点击硬盘以查看更过信息:


点击属性标签:


点击性能测试标签进行快速或全面的硬盘测试:


参考资料:

* smartctl 帮助文档

*在Linux或Unix下用smartd 监测硬盘状况 点击打开链接