[[Rsync de backup]] #contents *smartd[5262]: [#y57fd282] Jul 23 15:07:55 G7 smartd[5262]: Device: /dev/ada1, WARNING: There are known problems with these drives, Jul 23 15:07:55 G7 smartd[5262]: see the following Seagate web pages: Jul 23 15:07:55 G7 smartd[5262]: http://knowledge.seagate.com/articles/en_US/FAQ/207931en Jul 23 15:07:55 G7 smartd[5262]: http://knowledge.seagate.com/articles/en_US/FAQ/207963en Jul 23 15:07:56 G7 smartd[5262]: Device: /dev/ada3, WARNING: There are known problems with these drives, Jul 23 15:07:56 G7 smartd[5262]: THIS DRIVE MAY OR MAY NOT BE AFFECTED, Jul 23 15:07:56 G7 smartd[5262]: see the following web pages for details: Jul 23 15:07:56 G7 smartd[5262]: http://knowledge.seagate.com/articles/en_US/FAQ/207931en Jul 23 15:07:56 G7 smartd[5262]: http://knowledge.seagate.com/articles/en_US/FAQ/207951en Jul 23 15:07:56 G7 smartd[5262]: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=632758 *** portinstall sysutils/smartmontools [#z1a915a8] /bin/mkdir -p /usr/local/etc/periodic/daily install -o root -g wheel -m 555 /usr/ports/sysutils/smartmontools/work/smart /usr/local/etc/periodic/daily/smart smartmontools has been installed To check the status of drives, use the following: /usr/local/sbin/smartctl -a /dev/ad0 for first ATA/SATA drive /usr/local/sbin/smartctl -a /dev/da0 for first SCSI drive /usr/local/sbin/smartctl -a /dev/ada0 for first SATA drive To include drive health information in your daily status reports, add a line like the following to /etc/periodic.conf: daily_status_smart_devices="/dev/ad0 /dev/da0" substituting the appropriate device names for your SMART-capable disks. To enable drive monitoring, you can use /usr/local/sbin/smartd. A sample configuration file has been installed as /usr/local/etc/smartd.conf.sample Copy this file to /usr/local/etc/smartd.conf and edit appropriately To have smartd start at boot echo 'smartd_enable="YES"' >> /etc/rc.conf ===> Compressing manual pages for smartmontools-5.42_4 ===> Registering installation for smartmontools-5.42_4 ===> Cleaning for smartmontools-5.42_4 http://nhh.mo-blog.jp/ttt/2006/06/smartmontools_0720.html http://www.kkaneko.com/rinkou/freebsd/smartmontoolsfreebsd.html *** echo 'smartd_enable="YES"' >> /etc/rc.conf [#va21e2b9] ↑するか、もしくは、↓ /etc/rc.conf smartd_enable="YES" **接続されているHDDのデバイス名を調べる [#z4100d91] guard# atacontrol list ATA channel 0: Master: no device present Slave: no device present ATA channel 1: Master: no device present Slave: no device present ATA channel 2: Master: ad4 <WDC WD1602ABYS-19B7A0/02.03B03> SATA revision 2.x Slave: no device present ATA channel 3: Master: no device present Slave: no device present ATA channel 4: Master: no device present Slave: no device present ATA channel 5: Master: acd0 <HL-DT-ST DVDROM DH20N/NC04> SATA revision 1.x Slave: no device present おまけ guard# atacontrol cap ad4 とするとシリアル番号、モデル名なども表示します。 **接続されているHDDのデバイス名を調べる FreeBSD 9.0R 以降 [#g0f0f5e9] FreeBSD 9.0R以降では、 # atacontrol list atacontrol: ATA_CAM option is enabled in kernel. Please use camcontrol instead. デフォルトで ATA to CAM が有効になってて、camcontrol を使ってねってことになったった。 G7# camcontrol devlist <VB0250EAVER HPG7> at scbus0 target 0 lun 0 (ada0,pass0) <ST3500320NS SN05> at scbus0 target 1 lun 0 (ada1,pass1) <Hitachi HDS721050CLA362 JP2OA39C> at scbus1 target 0 lun 0 (ada2,pass2) <ST3500320AS SD15> at scbus1 target 1 lun 0 (ada3,pass3) <hp DVDROM DH40N IS01> at scbus3 target 0 lun 0 (cd0,pass4) ***(オプション)/etc/periodic.conf の設定 [#o0685287] smartctl コマンドで表示される状況レポートに, 日毎レポート (dairy status reports) を含めたいときは, /etc/periodic.conf に次のような1行を含めておく. 「/dev/ad0 /dev/da0」の部分は監視したいドライブ名に設定すること. /etc/periodic.conf daily_status_smart_devices="/dev/ad0 /dev/da0" ドライブの監視 (monitoring) を行いたいときは,設定ファイル /usr/local/etc/smartd.conf を作成すること. ※ サンプルが /usr/local/etc/smartd.conf.sample にある ** smartmontoolsの設定 [#h7e8a3e6] http://nhh.mo-blog.jp/ttt/2006/06/smartmontools_0720.html /usr/local/etc/smartd.conf.sample という設定ファイルがあるので、smartd.confというファイル名でコピーして、中身を書き換えます。 # cd /usr/local/etc/ # cp smartd.conf.sample smartd.conf # ls -l smartd.conf -r--r--r-- 1 root wheel 4890 Jun 12 22:59 smartd.conf # chmod +w smartd.conf # vi smartd.conf smartd.confに、ぎっしりと、いろんな情報が書いてあるので、それを読めば、だいたい、どう設定すればいいのかわかります。また、「man smartd.conf」でマニュアルも見られます。 smartd.confで設定すべきポイントは、2つくらいかな。 *** 「DEVICESCAN」という行をコメントアウトする [#jadba409] DEVICESCANという行以降に書いてある内容は、無視されるそうです。 # The word DEVICESCAN will cause any remaining lines in this # configuration file to be ignored: *** ディスクドライブごとにチェック項目を書いていく [#v0e418a1] 実はよくわかってないのですが(無責任ですみません)、smartd.confの中にサンプルがたくさん書かれているので、それをまねして、以下のように書きました。 guard の場合は /dev/ad4 -a -o on -S on -s (S/../.././03|L/../../6/07) -H -m root guard# /usr/local/etc/rc.d/smartd start G7だと、 /dev/ada0 -a -o on -S on -s (S/../.././03|L/../../6/07) -H -m root /dev/ada1 -a -o on -S on -s (S/../.././04|L/../../6/08) -H -m root /dev/ada2 -a -o on -S on -s (S/../.././05|L/../../6/09) -H -m root /dev/ada3 -a -o on -S on -s (S/../.././06|L/../../6/10) -H -m root &ref(IMG_20120626_144826.jpg{, [zoom], [50%]}); &ref(http://piano2nd.smb.net/~kuji/pukiwiki-1.4.7/index.php?plugin=attach&pcmd=open&file=IMG_20120626_144826.jpg&refer=HDD%E7%AE%A1%E7%90%86%20sysutils%2Fsmartmontools); SATAのハードディスクが4台つながっていて、ada0~ada3として認識されてるので、4行書いているのですが、1台だけなら/dev/ada0の行だけで十分。 「-s」で、自己診断テスト(self-test)を定期的に行うように指定する。short testとか、longテストとか、いろいろあるらしい。 「-m root」で、エラーが発生したら、rootあてにメールを送る。 というような意味らしいです。 *** smartctlコマンドで、ドライブの情報を読み出す [#jce36a73] # smartctl -a /dev/ada6