2010/06/16

S.M.A.R.T.で診断してみた

日経Linux : Linux Q & A
smartctl の出力についてまとめてみた - BitWalker
Linux向けハードディスク監視/設定アプリケーションの紹介

最近暑くなってきてHDDの調子が気になったので調べてみた
あんまり参考にならない?なんて事も言われていますが
見ないより見た方がいいんじゃね?ってことで


インストール

# yum install smartmontools


まずS.M.A.R.T.に対応しているか調べましょう
(対応してないことなんて滅多にないと思うけど)

# smartctl -i /dev/sda
smartctl 5.39.1 2010-01-28 r3054 [x86_64-redhat-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Model Family: Hitachi Deskstar 7K1000
Device Model: Hitachi HDS721010KLA330
Serial Number: XXXXXXXXXXXXXX
Firmware Version: GKAOAB0A
User Capacity: 1,000,204,886,016 bytes
Device is: In smartctl database [for details use: -P show]
ATA Version is: 7
ATA Standard is: ATA/ATAPI-7 T13 1532D revision 1
Local Time is: Thu Jun 17 02:09:14 2010 JST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled


うちでは対応(Available)しているし、既に有効(Enabled)になってるみたいです
無効になってる場合は以下のコマンドで有効にできる
(ちなみにoffにすると無効になるけどなにかメリットはあるのかな?)

# smartctl -s on /dev/sda
smartctl 5.39.1 2010-01-28 r3054 [x86_64-redhat-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF ENABLE/DISABLE COMMANDS SECTION ===
SMART Enabled.


で、とりあえず今結果を知りたいんだよって人は

# smartctl -H /dev/sda
smartctl 5.39.1 2010-01-28 r3054 [x86_64-redhat-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

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


PASSEDなのでOKみたい、手動でテストを開始する場合には
(shortをlongにすると結構待たされるみたい、今回はとりあえずshortで)

# smartctl -t short /dev/sda
smartctl 5.39.1 2010-01-28 r3054 [x86_64-redhat-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Execute SMART Short self-test routine immediately in off-line mode".
Drive command "Execute SMART Short self-test routine immediately in off-line mode" successful.
Testing has begun.
Please wait 1 minutes for test to complete.
Test will complete after Wed Jun 16 18:26:39 2010

Use smartctl -X to abort test.


1分待ってねって言われるので1分後に

# smartctl -l selftest /dev/sda
smartctl 5.39.1 2010-01-28 r3054 [x86_64-redhat-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF READ SMART DATA SECTION ===
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% 3250 -


Completed without errorなので一応エラーは出てないみたいです
エラーログは以下のコマンドで見れます

# smartctl -l error /dev/sda
smartctl 5.39.1 2010-01-28 r3054 [x86_64-redhat-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF READ SMART DATA SECTION ===
SMART Error Log Version: 1
No Errors Logged


HDDの情報とかS.M.A.R.T.のデータとか上記含む情報を全部表示するには

# smartctl -a /dev/sda
smartctl 5.39.1 2010-01-28 r3054 [x86_64-redhat-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF INFORMATION SECTION ===
Model Family: Hitachi Deskstar 7K1000
Device Model: Hitachi HDS721010KLA330
Serial Number: XXXXXXXXXXXXXX
Firmware Version: GKAOAB0A
User Capacity: 1,000,204,886,016 bytes
Device is: In smartctl database [for details use: -P show]
ATA Version is: 7
ATA Standard is: ATA/ATAPI-7 T13 1532D revision 1
Local Time is: Thu Jun 17 02:26:30 2010 JST
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: (0x85) Offline data collection activity
was aborted 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: (15354) seconds.
Offline data collection
capabilities: (0x5b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
No 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: ( 1) minutes.
Extended self-test routine
recommended polling time: ( 255) minutes.
SCT capabilities: (0x003f) SCT Status 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 0x000b 100 100 016 Pre-fail Always - 0
2 Throughput_Performance 0x0005 130 130 054 Pre-fail Offline - 152
3 Spin_Up_Time 0x0007 104 104 024 Pre-fail Always - 669 (Average 670)
4 Start_Stop_Count 0x0012 100 100 000 Old_age Always - 1130
5 Reallocated_Sector_Ct 0x0033 100 100 005 Pre-fail Always - 0
7 Seek_Error_Rate 0x000b 100 100 067 Pre-fail Always - 0
8 Seek_Time_Performance 0x0005 100 100 020 Pre-fail Offline - 0
9 Power_On_Hours 0x0012 100 100 000 Old_age Always - 3258
10 Spin_Retry_Count 0x0013 100 100 060 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 1129
192 Power-Off_Retract_Count 0x0032 099 099 000 Old_age Always - 1359
193 Load_Cycle_Count 0x0012 099 099 000 Old_age Always - 1359
194 Temperature_Celsius 0x0002 153 153 000 Old_age Always - 39 (Lifetime Min/Max 9/48)
196 Reallocated_Event_Count 0x0032 100 100 000 Old_age Always - 0
197 Current_Pending_Sector 0x0022 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0008 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x000a 200 200 000 Old_age Always - 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% 3250 -

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.


Pre-failがたくさん出てびっくりしたけどそういうものらしい
VALUEとWORSTがTHRESHを下回っていなければいいみたい
だけど1、5、196、197、198の項目は重要で
RAW_VALUEが0じゃない場合は結構やばいらしい
というわけで一応S.M.A.R.T.的には大丈夫って判断らしい
温度が39度ってのはもうちょっと冷やした方がいいのかなぁ

0 件のコメント:

コメントを投稿