差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン 次のリビジョン両方とも次のリビジョン | ||
linux:s.m.a.r.t [2019/09/10 13:52] – [致命的なエラーを見極める] ともやん | linux:s.m.a.r.t [2024/01/13 13:55] – [致命的なエラーを見極める] ともやん | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== Linux で ハードディスクの S.M.A.R.T 情報の取得 ====== | + | ====== Linux でハードディスクの S.M.A.R.T 情報の取得 ====== |
+ | < | ||
+ | <!-- a8net --> | ||
+ | <a href=" | ||
+ | <img border=" | ||
+ | <img border=" | ||
+ | </ | ||
+ | < | ||
+ | <!-- a8net --> | ||
+ | <a href=" | ||
+ | <img border=" | ||
+ | </ | ||
===== S.M.A.R.Tとは... ===== | ===== S.M.A.R.Tとは... ===== | ||
行 6: | 行 17: | ||
===== smartmontoolsインストール ===== | ===== smartmontoolsインストール ===== | ||
smartctlを利用するためには、smartmontoolsパッケージをインストールする。\\ | smartctlを利用するためには、smartmontoolsパッケージをインストールする。\\ | ||
- | <code> | + | <WRAP color_term> |
- | $ sudo dnf install smartmontools | + | <WRAP color_command>< |
- | </code> | + | <b class=GRN> |
+ | </pre></ | ||
+ | <WRAP color_result_long>< | ||
+ | メタデータの期限切れの最終確認: | ||
+ | 依存関係が解決しました。 | ||
+ | =============================================================================================================== | ||
+ | | ||
+ | =============================================================================================================== | ||
+ | インストール: | ||
+ | <b class=GRN> | ||
+ | 依存関係のインストール: | ||
+ | <b class=GRN> | ||
+ | |||
+ | トランザクションの概要 | ||
+ | =============================================================================================================== | ||
+ | インストール | ||
+ | |||
+ | ダウンロードサイズの合計: | ||
+ | インストール後のサイズ: | ||
+ | これでよろしいですか? | ||
+ | パッケージのダウンロード: | ||
+ | (1/2): smartmontools-selinux-7.3-2.fc36.noarch.rpm | ||
+ | (2/2): smartmontools-7.3-2.fc36.x86_64.rpm | ||
+ | --------------------------------------------------------------------------------------------------------------- | ||
+ | 合計 | ||
+ | トランザクションの確認を実行中 | ||
+ | トランザクションの確認に成功しました。 | ||
+ | トランザクションのテストを実行中 | ||
+ | トランザクションのテストに成功しました。 | ||
+ | トランザクションを実行中 | ||
+ | 準備 | ||
+ | scriptletの実行中: | ||
+ | インストール中 | ||
+ | scriptletの実行中: | ||
+ | libsemanage.semanage_direct_install_info: | ||
+ | Failed to set unit properties on smartd.service: | ||
+ | |||
+ | インストール中 | ||
+ | scriptletの実行中: | ||
+ | Created symlink / | ||
+ | |||
+ | 検証 | ||
+ | 検証 | ||
+ | |||
+ | インストール済み: | ||
+ | smartmontools-1: | ||
+ | |||
+ | 完了しました! | ||
+ | </ | ||
+ | </WRAP> | ||
===== S.M.A.R.T 情報の取得 ===== | ===== S.M.A.R.T 情報の取得 ===== | ||
S.M.A.R.T 情報を取得するには、以下のコマンドを実行する。\\ | S.M.A.R.T 情報を取得するには、以下のコマンドを実行する。\\ | ||
- | <code> | + | <WRAP color_term> |
- | $ sudo smartctl -a /dev/sda | + | <WRAP color_command>< |
- | </code> | + | <b class=GRN> |
+ | </pre></ | ||
+ | <WRAP color_result>< | ||
+ | </ | ||
+ | </ | ||
SATAのRAIDカード経由の場合は、-d ata オプションを追加する。 | SATAのRAIDカード経由の場合は、-d ata オプションを追加する。 | ||
- | <code> | + | <WRAP color_term> |
- | $ sudo smartctl -a -d ata /dev/sda | + | <WRAP color_command>< |
- | </code> | + | <b class=GRN> |
+ | </pre></ | ||
+ | <WRAP color_result>< | ||
+ | </ | ||
+ | </WRAP> | ||
HighPoint RocketRAID カード経由の場合は、-d hpt,L/M または -d hpt,L/M/N オプションを追加する。\\ | HighPoint RocketRAID カード経由の場合は、-d hpt,L/M または -d hpt,L/M/N オプションを追加する。\\ | ||
L = コントローラID(1~4)\\ | L = コントローラID(1~4)\\ | ||
M = チャネル番号(1~8)\\ | M = チャネル番号(1~8)\\ | ||
N = PMPort番号(1~5)\\ | N = PMPort番号(1~5)\\ | ||
- | <code> | + | |
- | $ sudo smartctl -a -d hpt,1/1/1 /dev/sdb | + | <WRAP color_term> |
- | </code> | + | <WRAP color_command>< |
+ | <b class=GRN> | ||
+ | </pre></ | ||
+ | <WRAP color_result>< | ||
+ | </ | ||
+ | </ | ||
このとき指定するデバイス名(/ | このとき指定するデバイス名(/ | ||
デバイス名を調べるには、以下のコマンドを実行する。 | デバイス名を調べるには、以下のコマンドを実行する。 | ||
- | <code> | + | <WRAP color_term> |
- | $ sudo parted -l | + | <WRAP color_command>< |
+ | <b class=GRN> | ||
+ | </ | ||
+ | <WRAP color_result_long>< | ||
モデル: HPT DISK_2_0 (scsi) | モデル: HPT DISK_2_0 (scsi) | ||
ディスク /dev/sdb: 128GB | ディスク /dev/sdb: 128GB | ||
行 65: | 行 143: | ||
番号 | 番号 | ||
| | ||
- | </code> | + | </pre></ |
+ | </WRAP> | ||
/dev/sdb または /dev/sdc が HighPoint RocketRAID のアレイであることが分かる。\\ | /dev/sdb または /dev/sdc が HighPoint RocketRAID のアレイであることが分かる。\\ | ||
行 73: | 行 152: | ||
\\ | \\ | ||
例えば、物理ディスク1~4を利用してRAID5のアレイを2つ構成している場合、 | 例えば、物理ディスク1~4を利用してRAID5のアレイを2つ構成している場合、 | ||
- | < | + | <WRAP color_code> |
RAIDカードのチャネル | RAIDカードのチャネル | ||
hpt チャネル1 | hpt チャネル1 | ||
行 79: | 行 158: | ||
hpt チャネル3 | hpt チャネル3 | ||
hpt チャネル4 | hpt チャネル4 | ||
- | </ | + | </ |
コントローラID, | コントローラID, | ||
物理ディスクの S.M.A.R.T 情報を取得できる。\\ | 物理ディスクの S.M.A.R.T 情報を取得できる。\\ | ||
- | <code> | + | <WRAP color_term> |
- | $ sudo smartctl -a -d hpt,1/1/1 /dev/sdb --> Disk1の情報を表示 | + | <WRAP color_command>< |
- | $ sudo smartctl -a -d hpt,1/2/1 /dev/sdb --> Disk2の情報を表示 | + | <b class=GRN> |
- | $ sudo smartctl -a -d hpt,1/3/1 /dev/sdb --> Disk3の情報を表示 | + | <b class=GRN> |
- | $ sudo smartctl -a -d hpt,1/4/1 /dev/sdb --> Disk4の情報を表示 | + | <b class=GRN> |
- | </code> | + | <b class=GRN> |
- | <code> | + | </pre></ |
- | $ sudo smartctl -a -d hpt,1/1/1 /dev/sdc --> Disk1の情報を表示 | + | </WRAP> |
- | $ sudo smartctl -a -d hpt,1/2/1 /dev/sdc --> Disk2の情報を表示 | + | <WRAP color_term> |
- | $ sudo smartctl -a -d hpt,1/3/1 /dev/sdc --> Disk3の情報を表示 | + | <WRAP color_command>< |
- | $ sudo smartctl -a -d hpt,1/4/1 /dev/sdc --> Disk4の情報を表示 | + | <b class=GRN> |
- | </code> | + | <b class=GRN> |
+ | <b class=GRN> | ||
+ | <b class=GRN> | ||
+ | </ | ||
+ | </WRAP> | ||
===== 致命的なエラーを見極める ===== | ===== 致命的なエラーを見極める ===== | ||
行 99: | 行 183: | ||
[[http:// | [[http:// | ||
[[https:// | [[https:// | ||
+ | < | ||
+ | <!-- a8net --> | ||
+ | <a href=" | ||
+ | <img border=" | ||
+ | </ | ||
==== Vendor Specific SMART Attributes with Thresholds ==== | ==== Vendor Specific SMART Attributes with Thresholds ==== | ||
注目すべき情報は、 | 注目すべき情報は、 | ||
- | ^ID# | + | ^ ID# ^ ATTRIBUTE_NAME ^ 意味 ^ |
| 5|Reallocated_Sector_Ct|ハードディスクが読み・書き・検証エラーを見つけ、代替させた不良セクタ数。通常、代替セクタが発生しても気が付かないが、より多くのセクタが代替されるほど、ディスクの読み書きに影響を及ぼす。| | | 5|Reallocated_Sector_Ct|ハードディスクが読み・書き・検証エラーを見つけ、代替させた不良セクタ数。通常、代替セクタが発生しても気が付かないが、より多くのセクタが代替されるほど、ディスクの読み書きに影響を及ぼす。| | ||
|196|Reallocated_Event_Count|不良セクタから予備領域にデータを移した回数。データ移行に失敗した数も成功した数と同様にカウントアップされる。| | |196|Reallocated_Event_Count|不良セクタから予備領域にデータを移した回数。データ移行に失敗した数も成功した数と同様にカウントアップされる。| | ||
|197|Current_Pending_Sector|不安定なセクタ数。代替セクタに再配置されるのを待っているセクタの総数で、正しく読み取りできたばあいは除かれる。但し、エラーが発生する場合は代替セクタに移されて、不良セクタはマークされる。この値がゼロで残るならば、対応する領域の質が低いことを示す。| | |197|Current_Pending_Sector|不安定なセクタ数。代替セクタに再配置されるのを待っているセクタの総数で、正しく読み取りできたばあいは除かれる。但し、エラーが発生する場合は代替セクタに移されて、不良セクタはマークされる。この値がゼロで残るならば、対応する領域の質が低いことを示す。| | ||
|198|Offline_Uncorrectable|修復できないセクタの読み書き時のエラーの量を示す。この値が増えることは、ディスクの欠陥・機械的なサブシステムに問題があることを示す。| | |198|Offline_Uncorrectable|修復できないセクタの読み書き時のエラーの量を示す。この値が増えることは、ディスクの欠陥・機械的なサブシステムに問題があることを示す。| | ||
- | < | + | <WRAP color_code> |
5 Reallocated_Sector_Ct | 5 Reallocated_Sector_Ct | ||
- | </ | + | </code></ |
- | < | + | <WRAP color_code> |
196 Reallocated_Event_Count 0x0008 | 196 Reallocated_Event_Count 0x0008 | ||
197 Current_Pending_Sector | 197 Current_Pending_Sector | ||
198 Offline_Uncorrectable | 198 Offline_Uncorrectable | ||
- | </ | + | </code></ |
- | < | + | <WRAP color_code> |
Vendor Specific SMART Attributes with Thresholds: | Vendor Specific SMART Attributes with Thresholds: | ||
ID# ATTRIBUTE_NAME | ID# ATTRIBUTE_NAME | ||
行 149: | 行 237: | ||
100 Unknown_Attribute | 100 Unknown_Attribute | ||
101 Unknown_Attribute | 101 Unknown_Attribute | ||
- | </ | + | </code></ |
===== S.M.A.R.T 情報の出力例 ===== | ===== S.M.A.R.T 情報の出力例 ===== | ||
- | <code> | + | <WRAP color_term> |
- | $ sudo smartctl -d ata -a /dev/sda | + | <WRAP color_command>< |
+ | <b class=GRN> | ||
+ | </ | ||
+ | <WRAP color_result_long>< | ||
smartctl version 5.38 [x86_64-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen | smartctl version 5.38 [x86_64-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen | ||
Home page is http:// | Home page is http:// | ||
行 352: | 行 443: | ||
After scanning selected spans, do NOT read-scan remainder of disk. | 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. | If Selective self-test is pending on power-up, resume after 0 minute delay. | ||
- | </code> | + | </pre></ |
+ | </WRAP> | ||
- | ===== クラッシュしたHDDの出力例(;_;) ===== | + | ===== クラッシュした HDD の出力例😭 ===== |
==== すべての情報 ==== | ==== すべての情報 ==== | ||
- | <code> | + | <WRAP color_term> |
- | $ sudo smartctl -a /dev/sdc | + | <WRAP color_command>< |
+ | <b class=GRN> | ||
+ | </ | ||
+ | <WRAP color_result_long>< | ||
smartctl version 5.38 [x86_64-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen | smartctl version 5.38 [x86_64-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen | ||
Home page is http:// | Home page is http:// | ||
行 557: | 行 652: | ||
After scanning selected spans, do NOT read-scan remainder of disk. | 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. | If Selective self-test is pending on power-up, resume after 0 minute delay. | ||
- | </code> | + | </pre></ |
+ | </WRAP> | ||
==== エラーログ ==== | ==== エラーログ ==== | ||
- | <code> | + | <WRAP color_term> |
- | $ sudo smartctl -l error /dev/sdc | + | <WRAP color_command>< |
+ | <b class=GRN> | ||
+ | </ | ||
+ | <WRAP color_result_long>< | ||
smartctl version 5.38 [x86_64-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen | smartctl version 5.38 [x86_64-redhat-linux-gnu] Copyright (C) 2002-8 Bruce Allen | ||
Home page is http:// | Home page is http:// | ||
行 668: | 行 767: | ||
ef 03 0c 00 00 00 a0 0a 03: | ef 03 0c 00 00 00 a0 0a 03: | ||
27 00 00 00 00 00 e0 08 03: | 27 00 00 00 00 00 e0 08 03: | ||
- | </code> | + | </pre></ |
+ | </WRAP> | ||