smartmontoolsを使う

公開日: : smartmontools

実際にsmartmontoolsを使ってみます。
取れる情報は有用なものばかりです。

smartctlを実行する

smartmontoolsをインストールすると、smartctlコマンドがインストールされます。インストールされる場所はデフォルトでは/usr/local/sbin なので、パスが通ってなければ通しておくと便利かもしれません(状況に応じて)。

※使用するハード環境
HDDはMaxtor 5A300J0(300GB)が1本だけIDEケーブルに接続されている(/dev/hda)

1.smartctlはroot権限で実行しなければなりません。一般ユーザーでは Permission Denied とメッセージが表示されて実行できません。

$ /usr/local/sbin/smartctl -a /dev/hda
smartctl version 5.33 [i686-pc-linux-gnu] Copyright (C) 2002-4 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
Smartctl open device: /dev/hda failed: Permission denied

2.チェック対象となるデバイスのSMARTを有効にします。無効のままだと以下のようなメッセージが表示されます。SMARTを有効にするには、 smartctl -s on デバイス名 を実行するだけです。

/usr/local/sbin/smartctl -a /dev/hda
smartctl version 5.33 [i686-pc-linux-gnu] Copyright (C) 2002-4 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===
Device Model: Maxtor 5A300J0
Serial Number: A810LYGE
Firmware Version: RAMB1TV0
User Capacity: 300,001,443,840 bytes
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: 7
ATA Standard is: ATA/ATAPI-7 T13 1532D revision 0
Local Time is: Sat Jul 2 17:46:42 2005 JST
SMART support is: Available – device has SMART capability.SMART support is: Disabled
SMART Disabled. Use option -s with argument ‘on’ to enable it.

しかも、messagesにもエラーメッセージが出力されます。

Jul 2 17:46:42 localhost kernel: hda: drive_cmd: status=0x51 { DriveReady SeekComplete Error }
Jul 2 17:46:42 localhost kernel: hda: drive_cmd: error=0x04 { DriveStatusError}

3.SMARTを有効にして、SMART情報を全て取得してみます(長いです)。
実行コマンドは、 /usr/local/sbin/smartctl -s on -a /dev/hda  です。

# /usr/local/sbin/smartctl -s on -a /dev/hda
smartctl version 5.33 [i686-pc-linux-gnu] Copyright (C) 2002-4 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===
Device Model: Maxtor 5A300J0
Serial Number: A810LYGE
Firmware Version: RAMB1TV0
User Capacity: 300,001,443,840 bytes
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: 7
ATA Standard is: ATA/ATAPI-7 T13 1532D revision 0
Local Time is: Sat Jul 2 18:11:08 2005 JST
SMART support is: Available – device has SMART capability.
SMART support is: Enabled

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

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSEDGeneral SMART Values:
Offline data collection status: (0x00) Offline data collection activity
was never started.
Auto Offline Data Collection: Disabled.
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: ( 30) seconds.
Offline data collection
capabilities: (0x5b) SMART execute Offline immediate.
Auto Offline data collection on/off supp
ort.
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.
No General Purpose Logging support.
Short self-test routine
recommended polling time: ( 2) minutes.
Extended self-test routine
recommended polling time: ( 158) minutes.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
3 Spin_Up_Time 0x0027 252 252 063 Pre-fail Always –
958
4 Start_Stop_Count 0x0032 253 253 000 Old_age Always –
5
5 Reallocated_Sector_Ct 0x0033 253 253 063 Pre-fail Always –
0
6 Read_Channel_Margin 0x0001 253 253 100 Pre-fail Offline –
0
7 Seek_Error_Rate 0x000a 253 252 000 Old_age Always –
0
8 Seek_Time_Performance 0x0027 243 243 187 Pre-fail Always –
55804
9 Power_On_Hours 0x0032 246 246 000 Old_age Always –
27444
10 Spin_Retry_Count 0x002b 252 252 157 Pre-fail Always –
0
11 Calibration_Retry_Count 0x002b 252 252 223 Pre-fail Always –
0
12 Power_Cycle_Count 0x0032 253 253 000 Old_age Always –
64
192 Power-Off_Retract_Count 0x0032 253 253 000 Old_age Always –
0
193 Load_Cycle_Count 0x0032 253 253 000 Old_age Always –
0
194 Temperature_Celsius 0x0032 253 253 000 Old_age Always –
37
195 Hardware_ECC_Recovered 0x000a 253 252 000 Old_age Always –
23646
196 Reallocated_Event_Count 0x0008 253 253 000 Old_age Offline –
0
197 Current_Pending_Sector 0x0008 253 253 000 Old_age Offline –
1
198 Offline_Uncorrectable 0x0008 253 252 000 Old_age Offline –
0
199 UDMA_CRC_Error_Count 0x0008 199 199 000 Old_age Offline –
0
200 Multi_Zone_Error_Rate 0x000a 253 252 000 Old_age Always –
0
201 Soft_Read_Error_Rate 0x000a 253 252 000 Old_age Always –
103
202 TA_Increase_Count 0x000a 253 252 000 Old_age Always –
0
203 Run_Out_Cancel 0x000b 253 252 180 Pre-fail Always –
1
204 Shock_Count_Write_Opern 0x000a 253 252 000 Old_age Always –
0
205 Shock_Rate_Write_Opern 0x000a 253 252 000 Old_age Always –
0
207 Spin_High_Current 0x002a 252 252 000 Old_age Always –
0
208 Spin_Buzz 0x002a 252 252 000 Old_age Always –
0
209 Offline_Seek_Performnce 0x0024 253 253 000 Old_age Offline –
0
99 Unknown_Attribute 0x0004 253 253 000 Old_age Offline –
0
100 Unknown_Attribute 0x0004 253 253 000 Old_age Offline –
0
101 Unknown_Attribute 0x0004 253 253 000 Old_age Offline –
0SMART Error Log Version: 1
Warning: ATA error count 156 inconsistent with error log pointer 5ATA Error Count: 156 (device log contains only the most recent five errors)
CR = Command Register [HEX]
FR = Features Register [HEX]
SC = Sector Count Register [HEX]
SN = Sector Number Register [HEX]
CL = Cylinder Low Register [HEX]
CH = Cylinder High Register [HEX]
DH = Device/Head Register [HEX]
DC = Device Command Register [HEX]
ER = Error register [HEX]
ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It “wraps” after 49.710 days.Error 156 occurred at disk power-on lifetime: 2476 hours (103 days + 4 hours)
When the command that caused the error occurred, the device was in an unknown
state.


Sponsored Link

After command completion occurred, registers were:
ER ST SC SN CL CH DH
— — — — — — —
04 51 00 0b 4f c2 e0 Error: ABRT

Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
— — — — — — — — —————- ——————–
b0 da 00 00 4f c2 e0 08 24d+03:09:21.920 SMART RETURN STATUS
25 00 08 38 ec e3 e0 08 24d+03:09:21.920 READ DMA EXT
25 00 08 98 fc e3 e0 08 24d+03:09:21.904 READ DMA EXT
ec 00 00 f3 59 bb e0 08 24d+03:09:21.872 IDENTIFY DEVICE
35 00 08 ec 59 bb e0 08 24d+03:09:21.712 WRITE DMA EXT

Error 155 occurred at disk power-on lifetime: 2453 hours (102 days + 5 hours)
When the command that caused the error occurred, the device was in an unknown
state.

After command completion occurred, registers were:
ER ST SC SN CL CH DH
— — — — — — —
04 51 05 01 00 00 a0 Error: ABRT

Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
— — — — — — — — —————- ——————–
a1 00 05 01 00 00 a0 08 23d+00:23:46.864 IDENTIFY PACKET DEVICE
20 00 01 ff 03 fb e0 08 23d+00:04:54.560 READ SECTOR(S)
20 00 01 00 00 00 e0 08 23d+00:04:54.560 READ SECTOR(S)
20 00 01 00 00 00 e0 08 23d+00:04:54.544 READ SECTOR(S)
e3 00 00 00 aa 00 a0 08 23d+00:04:54.544 IDLE

Error 154 occurred at disk power-on lifetime: 2453 hours (102 days + 5 hours)
When the command that caused the error occurred, the device was in an unknown
state.

After command completion occurred, registers were:
ER ST SC SN CL CH DH
— — — — — — —
04 51 05 01 00 00 a0 Error: ABRT

Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
— — — — — — — — —————- ——————–
a1 00 05 01 00 00 a0 08 23d+00:04:43.632 IDENTIFY PACKET DEVICE
25 00 08 30 fc 2b e0 08 23d+00:04:36.464 READ DMA EXT
25 00 08 88 fc 17 e0 08 23d+00:04:36.464 READ DMA EXT
25 00 20 18 fd 8f e0 08 23d+00:04:36.448 READ DMA EXT
25 00 20 f0 fc 8f e0 08 23d+00:04:36.448 READ DMA EXT

Error 153 occurred at disk power-on lifetime: 2319 hours (96 days + 15 hours)
When the command that caused the error occurred, the device was in an unknown
state.

After command completion occurred, registers were:
ER ST SC SN CL CH DH
— — — — — — —
04 51 05 01 00 00 a0 Error: ABRT

Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
— — — — — — — — —————- ——————–
a1 00 05 01 00 00 a0 08 16d+12:08:06.688 IDENTIFY PACKET DEVICE
25 00 08 30 fc 2b e0 08 16d+12:07:59.520 READ DMA EXT
25 00 08 88 fc 17 e0 08 16d+12:07:59.504 READ DMA EXT
25 00 20 18 fd 8f e0 08 16d+12:07:59.504 READ DMA EXT
25 00 20 f0 fc 8f e0 08 16d+12:07:59.504 READ DMA EXT

Error 152 occurred at disk power-on lifetime: 2244 hours (93 days + 12 hours)
When the command that caused the error occurred, the device was in an unknown
state.

After command completion occurred, registers were:
ER ST SC SN CL CH DH
— — — — — — —
04 51 00 0b 4f c2 e0 Error: ABRT

Commands leading to the command that caused the error were:
CR FR SC SN CL CH DH DC Powered_Up_Time Command/Feature_Name
— — — — — — — — —————- ——————–
b0 da 00 00 4f c2 e0 08 12d+20:59:56.768 SMART RETURN STATUS
25 00 08 98 fc e3 e0 08 12d+20:59:56.752 READ DMA EXT
25 00 40 74 54 eb e0 08 12d+20:59:56.720 READ DMA EXT
25 00 20 48 9d 6c e0 08 12d+20:59:56.720 READ DMA EXT
25 00 20 20 9d 6c e0 08 12d+20:59:56.720 READ DMA EXT

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% 2457 –
# 2 Short offline Completed without error 00% 2457 –
# 3 Short offline Completed without error 00% 2457 –
# 4 Short offline Completed without error 00% 2457 –
# 5 Short offline Completed without error 00% 2457 –
# 6 Short offline Completed: read failure 60% 930 554
097084

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.

smartctlによって、これだけの情報が取得できます。この中には、クリティカルな状態に繋がるような情報まで入っていて、これらの情報をうまく使用することで、ハードディスクトラブルを未然に防ぐ可能性が高くなるといえるでしょう。


Sponsored Link

関連記事

no image

smartmontoolsのインストール

smartmontoolsのインストールはいたって簡単。 インストール後はその機能を直ぐに使用でき

記事を読む

smartmontoolsの入手

smartmontoolsはフリーソフトです。 ダウンロードサイトから入手できます。 パッケージ

記事を読む

no image

smartmontoolsで取得できるSMART情報一覧

smartmontoolsで取得できる情報の一覧です。 感覚で書いているところもあるので間違ってい

記事を読む

Message

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です



smartmontoolsの入手

smartmontoolsはフリーソフトです。 ダウンロードサイトか

no image
smartmontoolsのインストール

smartmontoolsのインストールはいたって簡単。 インストー

no image
smartmontoolsを使う

実際にsmartmontoolsを使ってみます。 取れる情報は有用な

no image
smartmontoolsで取得できるSMART情報一覧

smartmontoolsで取得できる情報の一覧です。 感覚で書いて

→もっと見る

PAGE TOP ↑