Web Title:資訊安全資訊安全

Monitoring Hard Disks with SMART

Ref : https://www.linuxjournal.com/article/6983

 

 

smartctl -i /dev/hda


 

smartctl -Hc /dev/hda

smartctl -Hc /dev/hda

smartctl -A /dev/hda

smartctl -A /dev/hda
 

5 0x05 Reallocated Sector Count 重定位磁區計數
Dark Green Arrow Down.svg
記錄由於損壞而被對映到無失真的後備區的磁區計數。當硬碟出現損壞磁區時,可以通過將其物理空間指向到特定的無失真區域進行重對映修復,從而出現壞磁區的硬碟仍可使用。但當高過一定數值後,後磁區消耗殆盡而無法再重對映修復時,這些壞磁區就會顯現出來且無法自行修復。除外由於要要求磁頭讀取這些壞磁區時專門再移動到後備區讀寫資料,對硬碟讀寫效能也有影響。
7 0x07 Seek Error Rate 尋道錯誤率   (該屬性是特客製化造商才有的)磁頭尋找磁軌由於機械問題而出錯機率,有多種原因可能引致出錯,如:磁頭伺服構件,盤體過熱,或損壞。於不同廠商的不同計算方法而有所不同,其十進位值往往無意義的。
10 0x0a Spin Retry Count 電機起轉重試
Dark Green Arrow Down.svg
S.M.A.R.T參數電機起轉重試,表明了主軸電機的啟動嘗試次數。這個屬性儲存了關於主軸電機嘗試加速到完全可操作速度的次數(在這種情況下,意味著主軸電機的第一次啟動嘗試沒有成功)。主軸電機頻繁的嘗試啟動,意味著硬碟機的壽命可能將近實際限值。
188 0xbc Command Timeout 通訊超時
Dark Green Arrow Down.svg
由於無法連接至硬碟而終止操作的統計數,一般為0,如果遠超過0,則可能電源問題,資料線介面氧化或更嚴重的問題。
196 0xc4 Reallocation Event Count 重定位事件計數
Dark Green Arrow Down.svg
記錄已重對映磁區和可能重對映磁區的事件計數。
197 0xc5 Current Pending Sector Count 等候重定的磁區計數
Dark Green Arrow Down.svg
記錄了不穩定的磁區的數量。
198 0xc6 Uncorrectable Sector Count 無法校正的磁區計數
Dark Green Arrow Down.svg
記錄肯定出錯的磁區數量。

 

By wiki

If this normalized value is less than or equal to the threshold (THRESH),

the Attribute is said to have failed, as indicated in the WHEN_FAILED column.

smartctl -l error /dev/hda

two types of self-tests, short and long.

These can be run with the commands smartctl -t short /dev/hda and smartctl -t long /dev/hda and do not corrupt data on the disk.

root@xxx:~# smartctl -a  /dev/sda
smartctl 6.5 2016-01-24 r4214 [x86_64-linux-4.4.0-165-generic] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital RE3 Serial ATA
Device Model:     WDC WD5002ABYS-02B1B0
Serial Number:    WD-WCxxxxxxxxx2
LU WWN Device Id: 5 0014ee 204aadc36
Firmware Version: 02.03B03
User Capacity:    500,107,862,016 bytes [500 GB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    7200 rpm
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ATA8-ACS (minor revision not indicated)
SATA Version is:  SATA 2.5, 3.0 Gb/s
Local Time is:    Thu Nov  7 10:01:16 2019 CST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x84) Offline data collection activity
                                        was suspended by an interrupting command from host.
                                        Auto Offline Data Collection: Enabled.
Self-test execution status:      (   0) The previous self-test routine completed
                                        without error or no self-test has ever
                                        been run.
Total time to complete Offline
data collection:                ( 9480) seconds.
Offline data collection
capabilities:                    (0x7b) SMART execute Offline immediate.
                                        Auto Offline data collection on/off support.
                                        Suspend Offline collection upon new
                                        command.
                                        Offline surface scan supported.
                                        Self-test supported.
                                        Conveyance Self-test supported.
                                        Selective Self-test supported.
SMART capabilities:            (0x0003) Saves SMART data before entering
                                        power-saving mode.
                                        Supports SMART auto save timer.
Error logging capability:        (0x01) Error logging supported.
                                        General Purpose Logging supported.
Short self-test routine
recommended polling time:        (   2) minutes.
Extended self-test routine
recommended polling time:        ( 112) minutes.
Conveyance self-test routine
recommended polling time:        (   5) minutes.
SCT capabilities:              (0x303f) SCT Status supported.
                                        SCT Error Recovery Control supported.
                                        SCT Feature Control supported.
                                        SCT Data Table supported.

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
  1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       0
  3 Spin_Up_Time            0x0027   239   238   021    Pre-fail  Always       -       1016
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       181
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   001   001   000    Old_age   Always       -       72690
 10 Spin_Retry_Count        0x0032   100   100   000    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   100   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       180
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       133
193 Load_Cycle_Count        0x0032   200   200   000    Old_age   Always       -       47
194 Temperature_Celsius     0x0022   110   093   000    Old_age   Always       -       37
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       0

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed without error       00%      2981         -
# 2  Short offline       Completed without error       00%     64109         -

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

 

Worst = 曾經發生過最壞時的值
Value = 目前的值
Threshold = 門檻值,超過此值代表硬碟瑕疵已超過容許的範圍

只要數值曾低於門檻值(包括Worst),就代表這顆硬碟快掛了


代碼 / 項目 (代碼請自行換算16進位供查詢用)

1 Raw Read Error Rate 讀取錯誤率
代表硬碟出現瑕疵

2 Throughput Performance 輸出性能
硬碟可能出現瑕疵,或是整體性能老化

3 Spin Up Time 旋上時間
可能代表主軸馬達老化

4 Start/Stop Count 啟/停次數
這個值是硬碟主軸馬達啟動/關閉的次數,一般來說就是你開關電源的次數
由於硬碟馬達啟/停時磨耗最大,所以這是一個壽命參考值,但本身不具任何指標性

5 Reallocated Sector Count 重分配磁區數量
硬碟內部在發現弱磁區時會將弱磁區的資料重新分配到備用區,
這個值代表碟片可能出現瑕疵

6 Read Channel Margin 讀取通道臨界
代表硬碟可能出現瑕疵

7 Seek Error Rate 尋軌錯誤率
代表硬碟可能出現瑕疵

8 Seek Time Performance 尋軌效能
代表硬碟可能出現瑕疵,或是性能老化

9 Power-On Hours Count 總通電時間
硬碟總通電時間,這是一個壽命參考值,但本身不具任何指標性

10 Spin-up Retry Count 旋上重試次數
可能是電源供應不良,或是主軸馬達快掛了

11 Calibration Retry Count 校準重試次數
這個值下降代表硬碟可能出現瑕疵

12 Power Cycle Count 電源次數
這個值是硬碟電源/關閉的次數,一般來說就是你開關電源的次數
由於硬碟馬達啟/停時磨耗最大,所以這是一個壽命參考值,但本身不具任何指標性

13 Soft Read Error Rate 軟體讀取錯誤率
無法校正的讀取錯誤,通報給作業系統的次數,代表硬碟出現瑕疵

190 BE Airflow Temperature (WDC)
WD硬碟專有的氣流溫度偵測(與194同)

191 G-Sense Error Rate 衝擊偵測錯誤率
發生碰撞衝擊造成的錯誤率

192 Power-Off Retract Cycle 電源關閉次數 (Fujitsu: Emergency Retract Cycle
Count)
電源被關閉的次數

193 Load/Unload Cycle Count 從降落區起降的次數
這是一個壽命參考值,但本身不具任何指標性

194 HDA Temperature Temperature 硬碟總成溫度
溫度越低越好

195 Hardware ECC Recovered 硬體錯誤修正編碼修正
代表經由ECC修正的資料變多,讀出的資料狀態劣化,可能是出現老化或瑕疵

196 Reallocated Event Count 重分配事件數量
參照 5 Reallocated Sector Count ,這是發生的次數,越多次代表瑕疵越嚴重

197 Current Pending Sector Count 待決磁區數量
參照 5 Reallocated Sector Count ,這是有待重分配(尚未分配)的磁區數量


198 Off-line Scan Uncorrectable Count 離線掃描不可修正數量
在離線掃描時無法修正的錯誤數量,表示硬碟出現瑕疵

199 UltraDMA CRC Error Rate UDMA33傳輸錯誤率
是指電腦到硬碟間的資料傳輸錯誤率,一般是由不良的排線引起,與硬碟壽命較無關

200 Write Error Rate 寫入錯誤率 (WD:Multi Zone Error Rate)
這個值代表硬碟出現瑕疵

201 Soft Read Error Rate (Maxtor: Off Track Errors)
Frequency of the off track errors

202 Data Address Mark Errors 資料位置標記錯誤
代表硬碟可能出現瑕疵

203 Run Out Cancel ECC錯誤發生的頻率 (Maxtor: ECC Errors)
代表硬碟可能出現瑕疵

204 Soft ECC Correction 軟體ECC修正次數
由軟體修正的ECC次數,可能代表硬碟有瑕疵

205 Thermal Asperity Rate 過溫率
溫度過高的頻率,代表主軸馬達可能受損,或是散熱不良

206 Flying Height 磁頭飛行高度
可能意味主軸馬達老化,或磁頭出現瑕疵

207 Spin High Current 旋上高電流
主軸馬達旋上時所使用的電流量,耗電流變大意味著軸承可能有磨損

209 Offline Seek Performance 離線尋軌性能
可能代表硬碟老化

220 Disk Shift 磁碟位移
可能是磁碟遭受過強烈撞擊或熱漲冷縮

221 G-Sense Error Rate 震動偵測錯誤率
由外部引起的震動導致的錯誤率

222 Loaded Hours 作業時間
作業的總時間,這是一個壽命參考值,本身不具任何指標性

224 Load Friction 摩擦力
作業時的摩擦阻力

231 Temperature 溫度
溫度越低越好(由SMART軟體告知的溫度)

240 Head Flying Hours 磁頭飛行時間
這是一個壽命參考值,但本身不具任何指標性

250 Read Error Retry Rate 讀取錯誤重試率
代表硬碟出現瑕疵

 

Ref:http://southdogs.blogspot.com/2008/05/smart.html

搜尋