逆引きUNIXコマンド/smartctlコマンドを使ってみる
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
#navi(../)
* smartctlコマンドを使ってみる [#q4f79b04]
CentOS5にUSB接続したハードディスクの調子が悪そうでsmartct...
以下に備忘録としてsmartctlコマンドについて記述します。~
#contents
#htmlinsertpcsp(linux_ads_top.html,linux-sp.html)
* smartctlコマンドを使用した経緯 [#p3e4d4fa]
Logwatcherから以下のようなメールが届いていました。~
SmartdからWarningsを知らせるメッセージです。
--------------------- Smartd Begin ---------------------...
Warnings:
Warning via mail to root: successful - 1 Time(s)
Sending warning via mail to root ... - 1 Time(s)
---------------------- Smartd End ----------------------...
* [[S.M.A.R.T>http://ja.wikipedia.org/wiki/Self-Monitorin...
[[S.M.A.R.T>http://ja.wikipedia.org/wiki/Self-Monitoring,...
これにより、故障の早期発見などに役立ちます。
- [[S.M.A.R.T>http://ja.wikipedia.org/wiki/Self-Monitorin...
http://ja.wikipedia.org/wiki/Self-Monitoring,_Analysis_an...
* 関連資料 [#j430f53f]
Windows向けの資料ですが、[[S.M.A.R.T>http://ja.wikipedia....
-[[ハードディスクの異常がわかりやすい診断ソフト(HDD Smart...
-[[ハードディスク・SSDの健康診断ソフト>http://win.just4fu...
* smartctlを使ってみる [#o1f4dcec]
いくつかのオプションを使用してsmartctlコマンドを使ってみ...
以下にsmartctlコマンドの使用例を記します。~
尚、以下の操作はrootユーザにて作業しました。
** ハードディスクの情報の取得 -aオプション [#hf7cde00]
デバイス(ハードディスク)の情報を取得します。~
smartctl -a デバイス名
smartctl -hオプションを使用し-aオプションの動作を確認して...
[root@centos5 ~]# smartctl -h
<省略>
-a, --all ...
Show all SMART information for device
<省略>
実際にデバイス名/dev/sdaを指定して実行した時の出力です。
[root@centos5 ~]# smartctl -a /dev/sda
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.18-348....
Copyright (C) 2002-11 by Bruce Allen, http://smartmontoo...
=== START OF INFORMATION SECTION ===
Model Family: Hitachi Deskstar 7K2000
Device Model: Hitachi HDS722020ALA330
Serial Number: 12345678901234
LU WWN Device Id: 5 000000 222222222
Firmware Version: 11111111
User Capacity: 2,000,398,934,016 bytes [2.00 TB]
Sector Size: 512 bytes logical/physical
Device is: In smartctl database [for details use:...
ATA Version is: 8
ATA Standard is: ATA-8-ACS revision 4
Local Time is: Mon Apr 15 12:12:12 2013 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: (0x82) Offline data col...
was completed wi...
Auto Offline Dat...
<省略>
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH ...
1 Raw_Read_Error_Rate 0x000b 100 100 016 ...
2 Throughput_Performance 0x0005 133 133 054 ...
3 Spin_Up_Time 0x0007 113 113 024 ...
4 Start_Stop_Count 0x0012 100 100 000 ...
5 Reallocated_Sector_Ct 0x0033 100 100 005 ...
7 Seek_Error_Rate 0x000b 100 100 067 ...
8 Seek_Time_Performance 0x0005 121 121 020 ...
9 Power_On_Hours 0x0012 097 097 000 ...
10 Spin_Retry_Count 0x0013 100 100 060 ...
12 Power_Cycle_Count 0x0032 100 100 000 ...
<省略>
** テストをおこなう -tオプション [#z41038aa]
オプション-tを使用することによりセルフテストを実行するこ...
smartctl -t テストタイプ デバイス名
オプション-hを使用して-tオプションについて確認しました。
[root@centos5 ~]# smartctl -h
<省略>
-t TEST, --test=TEST
Run test. TEST: offline, short, long, conveyance,...
select,M-N, pending,N, afterselec...
<省略>
上記のshortとlongを実際につかってセルフテストを行ってみま...
*** shortを利用したセルフテスト [#ne9f8759]
+ rootにて-t shortでsmartctlコマンドを実行したときの出力...
[root@centos5 ~]# smartctl -t short /dev/sda
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.18-348....
Copyright (C) 2002-11 by Bruce Allen, http://smartmontoo...
=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Execute SMART Short self-test routine ...
Drive command "Execute SMART Short self-test routine imm...
Testing has begun.
Please wait 1 minutes for test to complete.
Test will complete after Mon Apr 15 18:36:23 2013
Use smartctl -X to abort test.
+ 一分待ってくださいと出力されたので、shortテストが終わる...
(終了メッセージが表示されないので、指定された時間を待つこ...
#br
+ オプション-Hを使用しステータスを表示する。~
PASSEDが表示されているのが確認できます。
[root@centos5 ~]# smartctl -h
<省略>
-H, --health
Show device SMART health status
<省略>
#br
[root@centos ~]# smartctl -H /dev/sda
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.18-348....
Copyright (C) 2002-11 by Bruce Allen, http://smartmontoo...
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
+ オプション-lを指定して結果を確認する。
[root@centos5 ~]# smartctl -h
<省略>
-l TYPE, --log=TYPE
Show device log. TYPE: error, selftest, selective...
xerror[,N][,error], xselft...
background, sasphy[,reset]...
scttemp[sts,hist], scttemp...
scterc[,N,M], devstat[,N],...
gplog,N[,RANGE], smartlog,...
<省略>
#br
[root@centos ~]# smartctl -l selftest /dev/sda
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.18-348....
Copyright (C) 2002-11 by Bruce Allen, http://smartmontoo...
=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num Test_Description Status Remaini...
# 1 Short offline Completed without error 0...
# 2 Extended offline Aborted by host 9...
# 3 Extended offline Aborted by host 9...
# 4 Short offline Completed without error 0...
*** longを利用したセルフテスト [#m2ec7449]
上記と同様にshortをlongに変更してsmartctlコマンドを実行し...
&color(red){結構時間がかかります。dfコマンドで確認したと...
[root@centos5 ~]# smartctl -t long /dev/sda
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.18-348....
Copyright (C) 2002-11 by Bruce Allen, http://smartmontoo...
=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Execute SMART Extended self-test routi...
Drive command "Execute SMART Extended self-test routine ...
Testing has begun.
Please wait 131 minutes for test to complete.
Test will complete after Mon Apr 15 21:24:39 2013
Use smartctl -X to abort test.
[root@centos5 ~]#
#br
+ 上記で指定された時間(時刻)まで待ちます。
+ 以下のコマンドでセルフテストの詳細な結果を出力すること...
smartctl -l selftest /dev/hda
+ 実際に上記コマンドを実行したときの出力です。
[root@centos5 ~]# smartctl -l selftest /dev/sda
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.18-348....
Copyright (C) 2002-11 by Bruce Allen, http://smartmontoo...
=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num Test_Description Status Remaini...
# 1 Extended offline Completed without error 0...
# 2 Short offline Completed without error 0...
# 3 Short offline Completed without error 0...
# 4 Short offline Aborted by host 7...
# 5 Short offline Completed without error 0...
** セルフテストを中止する [#q6f365dc]
上記で-tオプションを使用してセルフテストを行いました。~
その時、中止の方法も出力されています。
Use smartctl -X to abort test.
実際に使用するには、以下のようになります。
smartctl -X デバイス名
実際にセルフテストを実行して中止したときの出力です。
[root@centos5 ~]# smartctl -t short /dev/sda
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.18-348....
Copyright (C) 2002-11 by Bruce Allen, http://smartmontoo...
=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Execute SMART Short self-test routine ...
Drive command "Execute SMART Short self-test routine imm...
Testing has begun.
Please wait 1 minutes for test to complete.
Test will complete after Mon Apr 15 22:04:02 2013
Use smartctl -X to abort test.
[root@centos ~]# smartctl -X /dev/sda
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.18-348....
Copyright (C) 2002-11 by Bruce Allen, http://smartmontoo...
=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Abort SMART off-line mode self-test ro...
Self-testing aborted!
以上、smartctlコマンドの使用方法をいくつか紹介しました。
#htmlinsertpcsp(linux_ads_btm.html,linux-sp.html)
終了行:
#navi(../)
* smartctlコマンドを使ってみる [#q4f79b04]
CentOS5にUSB接続したハードディスクの調子が悪そうでsmartct...
以下に備忘録としてsmartctlコマンドについて記述します。~
#contents
#htmlinsertpcsp(linux_ads_top.html,linux-sp.html)
* smartctlコマンドを使用した経緯 [#p3e4d4fa]
Logwatcherから以下のようなメールが届いていました。~
SmartdからWarningsを知らせるメッセージです。
--------------------- Smartd Begin ---------------------...
Warnings:
Warning via mail to root: successful - 1 Time(s)
Sending warning via mail to root ... - 1 Time(s)
---------------------- Smartd End ----------------------...
* [[S.M.A.R.T>http://ja.wikipedia.org/wiki/Self-Monitorin...
[[S.M.A.R.T>http://ja.wikipedia.org/wiki/Self-Monitoring,...
これにより、故障の早期発見などに役立ちます。
- [[S.M.A.R.T>http://ja.wikipedia.org/wiki/Self-Monitorin...
http://ja.wikipedia.org/wiki/Self-Monitoring,_Analysis_an...
* 関連資料 [#j430f53f]
Windows向けの資料ですが、[[S.M.A.R.T>http://ja.wikipedia....
-[[ハードディスクの異常がわかりやすい診断ソフト(HDD Smart...
-[[ハードディスク・SSDの健康診断ソフト>http://win.just4fu...
* smartctlを使ってみる [#o1f4dcec]
いくつかのオプションを使用してsmartctlコマンドを使ってみ...
以下にsmartctlコマンドの使用例を記します。~
尚、以下の操作はrootユーザにて作業しました。
** ハードディスクの情報の取得 -aオプション [#hf7cde00]
デバイス(ハードディスク)の情報を取得します。~
smartctl -a デバイス名
smartctl -hオプションを使用し-aオプションの動作を確認して...
[root@centos5 ~]# smartctl -h
<省略>
-a, --all ...
Show all SMART information for device
<省略>
実際にデバイス名/dev/sdaを指定して実行した時の出力です。
[root@centos5 ~]# smartctl -a /dev/sda
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.18-348....
Copyright (C) 2002-11 by Bruce Allen, http://smartmontoo...
=== START OF INFORMATION SECTION ===
Model Family: Hitachi Deskstar 7K2000
Device Model: Hitachi HDS722020ALA330
Serial Number: 12345678901234
LU WWN Device Id: 5 000000 222222222
Firmware Version: 11111111
User Capacity: 2,000,398,934,016 bytes [2.00 TB]
Sector Size: 512 bytes logical/physical
Device is: In smartctl database [for details use:...
ATA Version is: 8
ATA Standard is: ATA-8-ACS revision 4
Local Time is: Mon Apr 15 12:12:12 2013 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: (0x82) Offline data col...
was completed wi...
Auto Offline Dat...
<省略>
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH ...
1 Raw_Read_Error_Rate 0x000b 100 100 016 ...
2 Throughput_Performance 0x0005 133 133 054 ...
3 Spin_Up_Time 0x0007 113 113 024 ...
4 Start_Stop_Count 0x0012 100 100 000 ...
5 Reallocated_Sector_Ct 0x0033 100 100 005 ...
7 Seek_Error_Rate 0x000b 100 100 067 ...
8 Seek_Time_Performance 0x0005 121 121 020 ...
9 Power_On_Hours 0x0012 097 097 000 ...
10 Spin_Retry_Count 0x0013 100 100 060 ...
12 Power_Cycle_Count 0x0032 100 100 000 ...
<省略>
** テストをおこなう -tオプション [#z41038aa]
オプション-tを使用することによりセルフテストを実行するこ...
smartctl -t テストタイプ デバイス名
オプション-hを使用して-tオプションについて確認しました。
[root@centos5 ~]# smartctl -h
<省略>
-t TEST, --test=TEST
Run test. TEST: offline, short, long, conveyance,...
select,M-N, pending,N, afterselec...
<省略>
上記のshortとlongを実際につかってセルフテストを行ってみま...
*** shortを利用したセルフテスト [#ne9f8759]
+ rootにて-t shortでsmartctlコマンドを実行したときの出力...
[root@centos5 ~]# smartctl -t short /dev/sda
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.18-348....
Copyright (C) 2002-11 by Bruce Allen, http://smartmontoo...
=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Execute SMART Short self-test routine ...
Drive command "Execute SMART Short self-test routine imm...
Testing has begun.
Please wait 1 minutes for test to complete.
Test will complete after Mon Apr 15 18:36:23 2013
Use smartctl -X to abort test.
+ 一分待ってくださいと出力されたので、shortテストが終わる...
(終了メッセージが表示されないので、指定された時間を待つこ...
#br
+ オプション-Hを使用しステータスを表示する。~
PASSEDが表示されているのが確認できます。
[root@centos5 ~]# smartctl -h
<省略>
-H, --health
Show device SMART health status
<省略>
#br
[root@centos ~]# smartctl -H /dev/sda
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.18-348....
Copyright (C) 2002-11 by Bruce Allen, http://smartmontoo...
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
+ オプション-lを指定して結果を確認する。
[root@centos5 ~]# smartctl -h
<省略>
-l TYPE, --log=TYPE
Show device log. TYPE: error, selftest, selective...
xerror[,N][,error], xselft...
background, sasphy[,reset]...
scttemp[sts,hist], scttemp...
scterc[,N,M], devstat[,N],...
gplog,N[,RANGE], smartlog,...
<省略>
#br
[root@centos ~]# smartctl -l selftest /dev/sda
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.18-348....
Copyright (C) 2002-11 by Bruce Allen, http://smartmontoo...
=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num Test_Description Status Remaini...
# 1 Short offline Completed without error 0...
# 2 Extended offline Aborted by host 9...
# 3 Extended offline Aborted by host 9...
# 4 Short offline Completed without error 0...
*** longを利用したセルフテスト [#m2ec7449]
上記と同様にshortをlongに変更してsmartctlコマンドを実行し...
&color(red){結構時間がかかります。dfコマンドで確認したと...
[root@centos5 ~]# smartctl -t long /dev/sda
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.18-348....
Copyright (C) 2002-11 by Bruce Allen, http://smartmontoo...
=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Execute SMART Extended self-test routi...
Drive command "Execute SMART Extended self-test routine ...
Testing has begun.
Please wait 131 minutes for test to complete.
Test will complete after Mon Apr 15 21:24:39 2013
Use smartctl -X to abort test.
[root@centos5 ~]#
#br
+ 上記で指定された時間(時刻)まで待ちます。
+ 以下のコマンドでセルフテストの詳細な結果を出力すること...
smartctl -l selftest /dev/hda
+ 実際に上記コマンドを実行したときの出力です。
[root@centos5 ~]# smartctl -l selftest /dev/sda
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.18-348....
Copyright (C) 2002-11 by Bruce Allen, http://smartmontoo...
=== START OF READ SMART DATA SECTION ===
SMART Self-test log structure revision number 1
Num Test_Description Status Remaini...
# 1 Extended offline Completed without error 0...
# 2 Short offline Completed without error 0...
# 3 Short offline Completed without error 0...
# 4 Short offline Aborted by host 7...
# 5 Short offline Completed without error 0...
** セルフテストを中止する [#q6f365dc]
上記で-tオプションを使用してセルフテストを行いました。~
その時、中止の方法も出力されています。
Use smartctl -X to abort test.
実際に使用するには、以下のようになります。
smartctl -X デバイス名
実際にセルフテストを実行して中止したときの出力です。
[root@centos5 ~]# smartctl -t short /dev/sda
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.18-348....
Copyright (C) 2002-11 by Bruce Allen, http://smartmontoo...
=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Execute SMART Short self-test routine ...
Drive command "Execute SMART Short self-test routine imm...
Testing has begun.
Please wait 1 minutes for test to complete.
Test will complete after Mon Apr 15 22:04:02 2013
Use smartctl -X to abort test.
[root@centos ~]# smartctl -X /dev/sda
smartctl 5.42 2011-10-20 r3458 [x86_64-linux-2.6.18-348....
Copyright (C) 2002-11 by Bruce Allen, http://smartmontoo...
=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Abort SMART off-line mode self-test ro...
Self-testing aborted!
以上、smartctlコマンドの使用方法をいくつか紹介しました。
#htmlinsertpcsp(linux_ads_btm.html,linux-sp.html)
ページ名: