linux:s.m.a.r.t

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
linux:s.m.a.r.t [2019/09/10 13:52] – [致命的なエラーを見極める] ともやんlinux:s.m.a.r.t [2024/01/13 13:56] (現在) – [致命的なエラーを見極める] ともやん
行 1: 行 1:
-====== Linux で ハードディスクの S.M.A.R.T 情報の取得 ======+====== Linux でハードディスクの S.M.A.R.T 情報の取得 ====== 
 +<html> 
 +<!-- a8net --> 
 +<a href="https://px.a8.net/svt/ejp?a8mat=3YYGEY+FAPZCI+2OYK+5ZU29" rel="nofollow"> 
 +<img border="0" width="120" height="60" alt="" src="https://www28.a8.net/svt/bgt?aid=240113050925&wid=001&eno=01&mid=s00000012566001007000&mc=1"></a> 
 +<img border="0" width="1" height="1" src="https://www12.a8.net/0.gif?a8mat=3YYGEY+FAPZCI+2OYK+5ZU29" alt=""> 
 +</html>\\ 
 +<html> 
 +<!-- a8net --> 
 +<a href="https://px.a8.net/svt/ejp?a8mat=3YYGEY+FAPZCI+2OYK+5YJRM" rel="nofollow">パソコン・スマホ・タブレット設定・IoT家電のお困りごとを解決!全国対応 G・O・G</a> 
 +<img border="0" width="1" height="1" src="https://www13.a8.net/0.gif?a8mat=3YYGEY+FAPZCI+2OYK+5YJRM" alt=""> 
 +</html>
  
 ===== 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><html><pre> 
-</code>+<b class=GRN>$</b> <b class=YEL>sudo</b> dnf install smartmontools 
 +</pre></html></WRAP> 
 +<WRAP color_result_long><html><pre> 
 +メタデータの期限切れの最終確認: 2:09:01 時間前の 2022年09月23日 12時04分15秒 に実施しました。 
 +依存関係が解決しました。 
 +=============================================================================================================== 
 + パッケージ                         アーキテクチャー    バージョン                  リポジトリー         サイズ 
 +=============================================================================================================== 
 +インストール: 
 + <b class=GRN>smartmontools</b>                      x86_64              1:7.3-2.fc36                updates              595 k 
 +依存関係のインストール: 
 + <b class=GRN>smartmontools-selinux</b>              noarch              1:7.3-2.fc36                updates               23 k 
 + 
 +トランザクションの概要 
 +=============================================================================================================== 
 +インストール  2 パッケージ 
 + 
 +ダウンロードサイズの合計: 618 k 
 +インストール後のサイズ: 2.0 M 
 +これでよろしいですか? [y/N]: y 
 +パッケージのダウンロード: 
 +(1/2): smartmontools-selinux-7.3-2.fc36.noarch.rpm                              99 kB/s |  23 kB     00:00     
 +(2/2): smartmontools-7.3-2.fc36.x86_64.rpm                                     1.1 MB/s | 595 kB     00:00     
 +--------------------------------------------------------------------------------------------------------------- 
 +合計                                                                           476 kB/s | 618 kB     00:01      
 +トランザクションの確認を実行中 
 +トランザクションの確認に成功しました。 
 +トランザクションのテストを実行中 
 +トランザクションのテストに成功しました。 
 +トランザクションを実行中 
 +  準備             :                                                                                       1/1  
 +  scriptletの実行中: smartmontools-selinux-1:7.3-2.fc36.noarch                                             1/2  
 +  インストール中   : smartmontools-selinux-1:7.3-2.fc36.noarch                                             1/2  
 +  scriptletの実行中: smartmontools-selinux-1:7.3-2.fc36.noarch                                             1/2  
 +libsemanage.semanage_direct_install_info: Overriding smartmon module at lower priority 100 with module at priority 200. 
 +Failed to set unit properties on smartd.service: Unit smartd.service not found. 
 + 
 +  インストール中   : smartmontools-1:7.3-2.fc36.x86_64                                                     2/2  
 +  scriptletの実行中: smartmontools-1:7.3-2.fc36.x86_64                                                     2/2  
 +Created symlink /etc/systemd/system/multi-user.target.wants/smartd.service → /usr/lib/systemd/system/smartd.service. 
 + 
 +  検証             : smartmontools-1:7.3-2.fc36.x86_64                                                     1/2  
 +  検証             : smartmontools-selinux-1:7.3-2.fc36.noarch                                             2/2  
 + 
 +インストール済み: 
 +  smartmontools-1:7.3-2.fc36.x86_64                  smartmontools-selinux-1:7.3-2.fc36.noarch                  
 + 
 +完了しました! 
 +</pre></html></WRAP> 
 +</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><html><pre> 
-</code>+<b class=GRN>$</b> <b class=YEL>sudo</b> smartctl -a /dev/sda 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre> 
 +</pre></html></WRAP> 
 +</WRAP> 
 SATAのRAIDカード経由の場合は、-d ata オプションを追加する。 SATAのRAIDカード経由の場合は、-d ata オプションを追加する。
-<code+<WRAP color_term
-$ sudo smartctl -a -d ata /dev/sda +<WRAP color_command><html><pre> 
-</code>+<b class=GRN>$</b> <b class=YEL>sudo</b> smartctl -a -d ata /dev/sda 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre> 
 +</pre></html></WRAP> 
 +</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><html><pre> 
 +<b class=GRN>$</b> <b class=YEL>sudo</b> smartctl -a -d hpt,1/1/1 /dev/sdb 
 +</pre></html></WRAP> 
 +<WRAP color_result><html><pre> 
 +</pre></html></WRAP> 
 +</WRAP> 
 このとき指定するデバイス名(/dev/sdb)は、RAIDカード配下のものであればどれでもよい。\\ このとき指定するデバイス名(/dev/sdb)は、RAIDカード配下のものであればどれでもよい。\\
 デバイス名を調べるには、以下のコマンドを実行する。 デバイス名を調べるには、以下のコマンドを実行する。
-<code+<WRAP color_term
-$ sudo parted -l+<WRAP color_command><html><pre> 
 +<b class=GRN>$</b> <b class=YEL>sudo</b> parted -l 
 +</pre></html></WRAP> 
 +<WRAP color_result_long><html><pre>
 モデル: HPT DISK_2_0 (scsi) モデル: HPT DISK_2_0 (scsi)
 ディスク /dev/sdb: 128GB ディスク /dev/sdb: 128GB
行 65: 行 143:
 番号  開始   終了    サイズ  ファイルシステム  フラグ 番号  開始   終了    サイズ  ファイルシステム  フラグ
     0.00B  2996GB  2996GB  ext4     0.00B  2996GB  2996GB  ext4
-</code>+</pre></html></WRAP> 
 +</WRAP>
 /dev/sdb または /dev/sdc が HighPoint RocketRAID のアレイであることが分かる。\\ /dev/sdb または /dev/sdc が HighPoint RocketRAID のアレイであることが分かる。\\
  
行 73: 行 152:
 \\ \\
 例えば、物理ディスク1~4を利用してRAID5のアレイを2つ構成している場合、 例えば、物理ディスク1~4を利用してRAID5のアレイを2つ構成している場合、
-<code>+<WRAP color_code><code>
 RAIDカードのチャネル  物理ディスク        アレイ        Linuxデバイス RAIDカードのチャネル  物理ディスク        アレイ        Linuxデバイス
 hpt チャネル1  ---->  Disk1    --+ hpt チャネル1  ---->  Disk1    --+
行 79: 行 158:
 hpt チャネル3  ---->  Disk3      |  -->  RAID5_1  -->  /dev/sdc hpt チャネル3  ---->  Disk3      |  -->  RAID5_1  -->  /dev/sdc
 hpt チャネル4  ---->  Disk4    --+ hpt チャネル4  ---->  Disk4    --+
-</code>+</code></WRAP> 
 コントローラID,チャネル番号,PMPort番号を指定することで、Linuxデバイス(/dev/sdb または /dev/sdc)を通して、\\ コントローラID,チャネル番号,PMPort番号を指定することで、Linuxデバイス(/dev/sdb または /dev/sdc)を通して、\\
 物理ディスクの 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><html><pre> 
-$ sudo smartctl -a -d hpt,1/2/1 /dev/sdb --> Disk2の情報を表示 +<b class=GRN>$</b> <b class=YEL>sudo</b> smartctl -a -d hpt,1/1/1 /dev/sdb<b class=DiYE> --> Disk1の情報を表示</b> 
-$ sudo smartctl -a -d hpt,1/3/1 /dev/sdb --> Disk3の情報を表示 +<b class=GRN>$</b> <b class=YEL>sudo</b> smartctl -a -d hpt,1/2/1 /dev/sdb<b class=DiYE> --> Disk2の情報を表示</b> 
-$ sudo smartctl -a -d hpt,1/4/1 /dev/sdb --> Disk4の情報を表示 +<b class=GRN>$</b> <b class=YEL>sudo</b> smartctl -a -d hpt,1/3/1 /dev/sdb<b class=DiYE> --> Disk3の情報を表示</b> 
-</code+<b class=GRN>$</b> <b class=YEL>sudo</b> smartctl -a -d hpt,1/4/1 /dev/sdb<b class=DiYE> --> Disk4の情報を表示</b> 
-<code+</pre></html></WRAP
-$ 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><html><pre> 
-$ sudo smartctl -a -d hpt,1/4/1 /dev/sdc --> Disk4の情報を表示 +<b class=GRN>$</b> <b class=YEL>sudo</b> smartctl -a -d hpt,1/1/1 /dev/sdc<b class=DiYE> --> Disk1の情報を表示</b> 
-</code>+<b class=GRN>$</b> <b class=YEL>sudo</b> smartctl -a -d hpt,1/2/1 /dev/sdc<b class=DiYE> --> Disk2の情報を表示</b> 
 +<b class=GRN>$</b> <b class=YEL>sudo</b> smartctl -a -d hpt,1/3/1 /dev/sdc<b class=DiYE> --> Disk3の情報を表示</b> 
 +<b class=GRN>$</b> <b class=YEL>sudo</b> smartctl -a -d hpt,1/4/1 /dev/sdc<b class=DiYE> --> Disk4の情報を表示</b> 
 +</pre></html></WRAP> 
 +</WRAP>
  
 ===== 致命的なエラーを見極める ===== ===== 致命的なエラーを見極める =====
 以下のサイトの文献が役に立つ。\\ 以下のサイトの文献が役に立つ。\\
 +<html>
 +<!-- a8net -->
 +<a href="https://px.a8.net/svt/ejp?a8mat=3YYGEY+FAPZCI+2OYK+5YJRM" rel="nofollow">パソコン・スマホ・タブレット設定・IoT家電のお困りごとを解決!全国対応 G・O・G</a>
 +<img border="0" width="1" height="1" src="https://www13.a8.net/0.gif?a8mat=3YYGEY+FAPZCI+2OYK+5YJRM" alt="">
 +</html>\\
 [[http://smart.jinaka.com/information_list.html|smartmontoolsで取得できるSMART情報一覧]]\\ [[http://smart.jinaka.com/information_list.html|smartmontoolsで取得できるSMART情報一覧]]\\
 [[https://ja.wikipedia.org/wiki/Self-Monitoring,_Analysis_and_Reporting_Technology|Self-Monitoring, Analysis and Reporting Technology - Wikipedia]]\\ [[https://ja.wikipedia.org/wiki/Self-Monitoring,_Analysis_and_Reporting_Technology|Self-Monitoring, Analysis and Reporting Technology - Wikipedia]]\\
行 102: 行 191:
 ==== Vendor Specific SMART Attributes with Thresholds ==== ==== Vendor Specific SMART Attributes with Thresholds ====
 注目すべき情報は、 注目すべき情報は、
-^ID#^ATTRIBUTE_NAME^意味^+^ 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|修復できないセクタの読み書き時のエラーの量を示す。この値が増えることは、ディスクの欠陥・機械的なサブシステムに問題があることを示す。|
-<code>+<WRAP color_code><code>
   5 Reallocated_Sector_Ct   0x0033   248   248   063    Pre-fail  Always             55   5 Reallocated_Sector_Ct   0x0033   248   248   063    Pre-fail  Always             55
-</code> +</code></WRAP
-<code>+<WRAP color_code><code>
 196 Reallocated_Event_Count 0x0008   253   253   000    Old_age   Offline      -       0 196 Reallocated_Event_Count 0x0008   253   253   000    Old_age   Offline      -       0
 197 Current_Pending_Sector  0x0008   253   253   000    Old_age   Offline      -       3 197 Current_Pending_Sector  0x0008   253   253   000    Old_age   Offline      -       3
 198 Offline_Uncorrectable   0x0008   253   253   000    Old_age   Offline      -       0 198 Offline_Uncorrectable   0x0008   253   253   000    Old_age   Offline      -       0
-</code>+</code></WRAP>
  
-<code>+<WRAP color_code><code>
 Vendor Specific SMART Attributes with Thresholds: Vendor Specific SMART Attributes with Thresholds:
 ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
行 149: 行 238:
 100 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      -       0 101 Unknown_Attribute       0x0004   253   253   000    Old_age   Offline      -       0
-</code>+</code></WRAP>
  
 ===== S.M.A.R.T 情報の出力例 ===== ===== S.M.A.R.T 情報の出力例 =====
-<code+<WRAP color_term
-$ sudo smartctl -d ata -a /dev/sda+<WRAP color_command><html><pre> 
 +<b class=GRN>$</b> <b class=YEL>sudo</b> smartctl -d ata -a /dev/sda 
 +</pre></html></WRAP> 
 +<WRAP color_result_long><html><pre>
 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://smartmontools.sourceforge.net/ Home page is http://smartmontools.sourceforge.net/
行 352: 行 444:
   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></html></WRAP> 
 +</WRAP>
  
-===== クラッシュしたHDDの出力例(;_;) =====+===== クラッシュした HDD の出力例😭 =====
  
 ==== すべての情報 ==== ==== すべての情報 ====
-<code+<WRAP color_term
-$ sudo smartctl -a /dev/sdc+<WRAP color_command><html><pre> 
 +<b class=GRN>$</b> <b class=YEL>sudo</b> smartctl -a /dev/sdc 
 +</pre></html></WRAP> 
 +<WRAP color_result_long><html><pre>
 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://smartmontools.sourceforge.net/ Home page is http://smartmontools.sourceforge.net/
行 557: 行 653:
   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></html></WRAP> 
 +</WRAP>
  
 ==== エラーログ ==== ==== エラーログ ====
-<code+<WRAP color_term
-$ sudo smartctl -l error /dev/sdc+<WRAP color_command><html><pre> 
 +<b class=GRN>$</b> <b class=YEL>sudo</b> smartctl -l error /dev/sdc 
 +</pre></html></WRAP> 
 +<WRAP color_result_long><html><pre>
 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://smartmontools.sourceforge.net/ Home page is http://smartmontools.sourceforge.net/
行 668: 行 768:
   ef 03 0c 00 00 00 a0 0a      03:01:50.272  SET FEATURES [Set transfer mode]   ef 03 0c 00 00 00 a0 0a      03:01:50.272  SET FEATURES [Set transfer mode]
   27 00 00 00 00 00 e0 08      03:01:50.272  READ NATIVE MAX ADDRESS EXT   27 00 00 00 00 00 e0 08      03:01:50.272  READ NATIVE MAX ADDRESS EXT
-</code>+</pre></html></WRAP> 
 +</WRAP>
  
  • linux/s.m.a.r.t.1568091143.txt.gz
  • 最終更新: 2019/09/10 13:52
  • by ともやん