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  です。


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

smartmontoolsメインメニュー