VineLinux3系

ハードディスクの状態を監視する。

家のvineは時々HDDエラーが出て止まる。エラーログを見ると、 grep dma messagage*

messages:Oct 31 04:22:01 shibaok kernel: hda: dma_intr: status=0x51 { DriveReady SeekComplete Error }
messages:Oct 31 04:22:01 shibaok kernel: hda: dma_intr: error=0x84 { DriveStatusError BadCRC }
messages.1:Oct 29 18:01:23 shibaok kernel: hda: dma_timer_expiry: dma status == 0x21
messages.1:Oct 30 01:33:43 shibaok kernel: hda: dma_timer_expiry: dma status == 0x21
messages.1:Oct 30 01:33:43 shibaok kernel: hda: dma timeout retry: status=0xd0 { Busy }

などとdmaに関する危ういメッセージを発見する。ハードディスクが色々と怪しいので調べてみることににする。ハードディスクは消費財なのでは、買い換えるのが本当は一番良い。

hdparmの導入

hdparmは、ATA/IDEのハードディスクの状態を調べたり、設定を変えたりする。Vine3.0で元から入っていた。 使い方は、

#hdparm -i /dev/hda

で色々な情報が引き出せる。その結果

dev/hda:
Model=IC25N020ATDA04-0, FwRev=DA3OA76A, SerialNo=63A63J08848
Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs }
RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4
BuffType=DualPortCache, BuffSize=1806kB, MaxMultSect=16, MultSect=16
CurCHS=17475/15/63, CurSects=16513875, LBA=yes, LBAsects=39070080
IORDY=on/off, tPIO={min:240,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes:  pio0 pio1 pio2 pio3 pio4
DMA modes:  mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 *udma2 udma3 udma4 udma5
AdvancedPM=yes: mode=0x80 (128) WriteCache=enabled
Drive conforms to: ATA/ATAPI-5 T13 1321D revision 3:  2 3 4 5

hdparm は、-dオプションでdmaのオンオフを切り替えるみたいだ。  #hdparm -d0 -k1 /dev/hda でudmaを無効に出来る。  #hdparm -d1 -k1 /dev/hda でudmaを有効に出来る。

smartmontoolsを導入する

S.M.A.R.Tというのは、HDDが内部で持っている自己診断ツールらしい。それを読み出すことでHDDの健康診断をする。 linuxでは、smartmontoolsを使う。

apt-get install smartmontools

でインストールできる。
smartmontoolsは、smartctlとsmartdで構成されいて、smartctlはコントロールや、現在の状況を知るのに使う。smartdは、デーモンとして常駐して、hddを監視する。

smartctl -A /dev/hda

で、現在の状況や、エラーの内容が表示される。その中のTemperatureはHDDの温度(摂氏)を示している。

94 Temperature_Celsius     0x0002   171   171   000    Old_age   Always       -       32 (Lifetime Min/Max 10/58)
smartctl -A /dev/hdaの内容
smartctl version 5.33 [i686-pc-linux-gnu] Copyright (C) 2002-4 Bruce Allen
ome page is http://smartmontools.sourceforge.net/
=== START OF INFORMATION SECTION ===
evice Model:     IC25N020ATDA04-0
erial Number:    63A63J08848
irmware Version: DA3OA76A
ser Capacity:    20,003,880,960 bytes
evice is:        In smartctl database [for details use: -P show]
TA Version is:   5
TA Standard is:  ATA/ATAPI-5 T13 1321D revision 3
ocal Time is:    Sat Oct 30 19:37:38 2004 JST
MART support is: Available - device has SMART capability.
MART support is: Enabled
=== START OF READ SMART DATA SECTION ===
MART overall-health self-assessment test result: PASSED
General SMART Values:
ffline data collection status:  (0x00)	Offline data collection activity
				was never started.
				Auto Offline Data Collection: Disabled.
elf-test execution status:      (   0)	The previous self-test routine completed
				without error or no self-test has ever 
				been run.
otal time to complete Offline 
ata collection: 		 ( 645) seconds.
ffline data collection
apabilities: 			 (0x1b) SMART execute Offline immediate.
				Auto Offline data collection on/off support.
				Suspend Offline collection upon new
				command.
				Offline surface scan supported.
				Self-test supported.
				No Conveyance Self-test supported.
				No Selective Self-test supported.
MART capabilities:            (0x0003)	Saves SMART data before entering
				power-saving mode.
				Supports SMART auto save timer.
rror logging capability:        (0x01)	Error logging supported.
				No General Purpose Logging support.
hort self-test routine 
ecommended polling time: 	 (   2) minutes.
xtended self-test routine
ecommended polling time: 	 (  27) minutes.
SMART Attributes Data Structure revision number: 16
endor Specific SMART Attributes with Thresholds:
D# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
 1 Raw_Read_Error_Rate     0x000b   097   097   062    Pre-fail  Always       -       458752
  1 Raw Read Error Rate  リードエラーの発生率 ▲
 2 Throughput_Performance  0x0005   100   100   040    Pre-fail  Offline      -       0
  2 Throughput Performance  規定通りの性能が出てるか ▲
 3 Spin_Up_Time            0x0007   127   127   033    Pre-fail  Always       -       1
  3 Spin Up Time  ディスクが回転してる時間
 4 Start_Stop_Count        0x0012   100   100   000    Old_age   Always       -       808
  4 Start/Stop Count  スタート・ストップ回数
 5 Reallocated_Sector_Ct   0x0033   100   100   005    Pre-fail  Always       -       0
  5 Reallocated Sector Count 不良セクタが発生して、代替処理されたセクタ数 ★ 
 7 Seek_Error_Rate         0x000b   100   100   067    Pre-fail  Always       -       0
  7 Seek Error Rate シークエラー率 ▲ 
 8 Seek_Time_Performance   0x0005   100   100   040    Pre-fail  Offline      -       0
  8 Seek Time Performance  シーク性能が正常かどうか ▲
 9 Power_On_Hours          0x0012   085   085   000    Old_age   Always       -       6763
  9 Power-On Hours Count  通電時間
10 Spin_Retry_Count        0x0013   100   100   060    Pre-fail  Always       -       0
 10 Spin Retry Count スピンアップを再試行した回数 ★ 
12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       500
 12 Device Power Cycle Count  電源入切回数
191 G-Sense_Error_Rate      0x000a   095   095   000    Old_age   Always       -       196621
 191 Gsense Error Rate  衝撃センサーが感知した加速度
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       20
 192 Power Off Retract Count  HDDをソフト的に停止させず電源を直に切ってヘッドが緊急退避(ダメージ大)をした回数
193 Load_Cycle_Count        0x0012   078   078   000    Old_age   Always       -       229522
 193 Load/Unload Cycle Count  ロード・アンロード回数
194 Temperature_Celsius     0x0002   171   171   000    Old_age   Always       -       32 (Lifetime Min/Max 10/58)
 194 Device Temperature  温度
196 Reallocated_Event_Count 0x0032   100   100   000    Old_age   Always       -       43
 196 Reallocation Event Count 代替セクタ処理が発生した回数 ★ 
197 Current_Pending_Sector  0x0022   100   100   000    Old_age   Always       -       0
 197 Current Pending Sector Count 現在異常があるセクタ数 ★ 
198 Offline_Uncorrectable   0x0008   100   100   000    Old_age   Offline      -       0
 198 Off-Line Scan Uncorrectable Sector Count オフラインスキャン時に訂正できなかったセクタ数 ★ 
199 UDMA_CRC_Error_Count    0x000a   200   200   000    Old_age   Always       -       9
 199 Ultra DMA CRC Error Count デバイス・ホスト間のIDE転送でエラーが発生した回数 ▲ 
 
★:最重要項目  この項目で警告が出た場合は即ドライブを交換
▲:重要項目   この項目で警告が出た場合はすぐにデータをバックアップ

トップ   差分 バックアップ リロード   一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2015-02-01 (日) 14:38:23 (3369d)