[[Rsync de backup]] portinstall sysutils/smartmontools /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 /etc/rc.conf smartd_enable="YES" /etc/periodic.conf daily_status_smart_devices="/dev/ada0 /dev/daa0" daily_status_smart_devices="/dev/ada1 /dev/daa1" daily_status_smart_devices="/dev/ada2 /dev/daa2" daily_status_smart_devices="/dev/ada3 /dev/daa3" ドライブの監視 (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という行以降に書いてある内容は、無視されるそうです。 これ・・・私、ず~っと知りませんでした。1年以上前からsmartmontoolsを使っていて、つい先日、気がつきました。ディスクドライブでエラーが発生したことを、メールで通知する機能がsmartmontoolsにはあるのですが、1度としてメールが来たことがなかったんです。でも、手でコマンドを実行して、SMARTのエラー記録を確認すると、知らないうちに、ポロポロとエラーが発生しているんです。 「なんでなんだろう?」・・・はっ!こんなことが書いてある・・・ # The word DEVICESCAN will cause any remaining lines in this # configuration file to be ignored: そうですか。私が悪かったんです。すみません。 *** ディスクドライブごとにチェック項目を書いていく [#v0e418a1] 実はよくわかってないのですが(無責任ですみません)、smartd.confの中にサンプルがたくさん書かれているので、それをまねして、以下のように書きました。 /dev/ad0 -a -o on -S on -s (S/../.././03|L/../../6/07) -H -m root /dev/ad1 -a -o on -S on -s (S/../.././04|L/../../6/08) -H -m root /dev/ad2 -a -o on -S on -s (S/../.././05|L/../../6/09) -H -m root /dev/ad3 -a -o on -S on -s (S/../.././06|L/../../6/10) -H -m root ATAのハードディスクが4台つながっていて、ad0~ad3として認識されてるので、4行書いているのですが、1台だけなら/dev/ad0の行だけで十分です。 「-s」で、自己診断テスト(self-test)を定期的に行うように指定する。short testとか、longテストとか、いろいろあるらしい。 「-m root」で、エラーが発生したら、rootあてにメールを送る。 というような意味らしいです。 *** smartctlコマンドで、ドライブの情報を読み出す [#jce36a73] # smartctl -a /dev/ad6