SMART使用指令

S.M.A.R.T. (Self-Monitoring, Analysis, and Reporting Technology)相關介紹

smart指令的使用

安裝

apt install smartmontools -y

檢視基本資料

smartctl -i {硬碟}

開啟SMART功能

smartctl -s on (硬碟)

簡單檢測(只回覆pass/failed)

smartctl -H (硬碟)

檢查硬碟

smartctl -t (檢查方式) (硬碟)

備註:
檢查方式:
offline              # 1. No entry is placed in the selftest log.
                       # 2. The effects of this test are visible only in that it updates the SMART offline Attribute values
short                # 立即聽到 harddisk 在做野 (check the electrical and mechanical performance)
long                 # 相當於 Offline Extended self-test
conveyance(輸送)        # intended to identify damage incurred during transporting of the device
select,M-N                 # to test a range of disk LBAs
pending,N
afterselect,on afterselect,off

加-d sat可以檢查usb硬碟

最常使用short

檢驗進度查詢

smartctl -c (硬碟)

終止測試

smartctl -X

檢查測試結果

smartctl -l error /dev/sdd

備註:
-l type          # Prints either the SMART Error Log (TYPE: error, selftest, selective, directory, ssd)
-l error    => offline test 要用此看
                    prints the Summary SMART error log
                    SMART disks maintain a log of the most recent five non-trivial errors
                    the disk  power-on lifetime at which the error occurred is recorded
-l selftest => "short", "long" test 要用此看
                    The time at which the test took place, measured in hours of disk lifetime
-l ssd       => prints the Solid State Media percentage used endurance indicator
                    (0 indicates as new condition while 100 indicates the device is at the end of its lifetime)
If any errors were detected, the Logical Block Address (LBA) of the first error is printed in decimal notation.

顯示所有硬碟資料

smartctl -A (硬碟)

 

知識補充:
哪幾個S.M.A.R.T.數據項目是最關乎HDD/SDD健康度的?

S.M.A.R.T.有好多項目,其中最能反映磁盤健康狀態的指標有下列幾個:

如何解讀S.M.A.R.T.數據中的Current、Normalized, Worst 和Threshold?

S.M.A.R.T. 系統不僅用來監視硬碟的多種參數,它還提供了一套框架來解讀這些參數的值。在S.M.A.R.T. 資料中有幾個重要的欄位,包括“Current”(當前)、“Worst”(最差)、“Threshold”(閾值)、和“Normalized”(標準化)。下面我們來分別解析這些術語和它們的意義:

“Current”(當前):

“Worst”(最差):

“Normalized”(標準化):

“Threshold”(閾值):

在解讀S.M.A.R.T. 值時,不僅要注意目前的參數值,也要考慮它們與閾值的關系以及它們隨時間的變化趨勢。如果有任何S.M.A.R.T. 值顯示潛在的問題,建議你及時備份所有重要的資料,以避免資料丟失。

參考網頁:

S.M.A.R.T. 健康度解讀:如何判斷磁盤前期損壞和不能忽視的局限性

 


Revision #2
Created 12 March 2025 03:22:07 by Ron
Updated 12 March 2025 04:01:24 by Ron