金子邦彦研究室インストールFreeBSDsmartmontools を用いたドライブ情報の取得(FreeBSD の場合)

smartmontools を用いたドライブ情報の取得(FreeBSD の場合)

smartmontools とは, FreeBSD 上で動く,システム情報の取得ツール. このページでは,FreeBSD (バージョン 8.1 を使用) での smartmontools のインストール手順を説明する.

前準備

(オプション) システム/アプリケーションの更新作業

  1. /etc/make.conf, /etc/src.conf の設定

    「FreeBSD 基本設定」の Web ページなどを参考に行う.

  2. FreeBSD の全てのソースコードの更新

    以下のようにコマンドを実行して,FreeBSD の全てのソースコードを更新します. このとき,同時に,ポーツ・ツリー (Ports Tree) の展開/更新も行われます(そのはずです)

    cd /usr/src
    make update
    
  3. portupggrade コマンドによるアプリケーションの更新

    cd /usr/ports/ports-mgmt/portupgrade
    make clean deinstall
    make
    make install
    rehash
    shutdown now
    portupgrade -a
    pkgdb -F
    sync
    sync
    sync
    sync
    sync
    reboot
    

smartmontools のインストールと設定手順

  1. ポーツツリーを使ってビルドとインストール

    ※ 数十秒で終わります.

    cd /usr/ports/sysutils/smartmontools; make clean deinstall; make; make install
    

    [image]
  2. インストール完了の確認

    エラーメッセージが出ていないこと.

    [image]
  3. (オプション)/etc/periodic.conf の設定

    smartctl コマンドで表示される状況レポートに, 日毎レポート (dairy status reports) を含めたいときは, /etc/periodic.conf に次のような1行を含めておく. 「/dev/ad0 /dev/da0」の部分は監視したいドライブ名に設定?すること.

    daily_status_smart_devices="/dev/ad0 /dev/da0"
    
  4. (オプション)/usr/local/etc/smartd.conf の設定

    ドライブの監視 (monitoring) を行いたいときは,設定ファイル /usr/local/etc/smartd.conf を作成すること.

    ※ サンプルが /usr/local/etc/smartd.conf.sample にある

    /etc/rc.conf に次の1行を含めておく. これで SMART デーモンが自動的に起動するようになる.

  5. (オプション)/etc/rc.conf の設定

    /etc/rc.conf に次の1行を含めておく. これで SMART デーモンが自動的に起動するようになる.

    smartd_enable="YES"
    

smartmontools を試しに使ってみる

ドライブ情報の取得

ドライブ情報の取得を行ってみる.

/dev/ad8」の部分は,扱いたいドライブ名にしてください.

/usr/local/sbin/smartctl -i /dev/ad8

■ 実行結果の例

モデル名 (Device Model), 容量 (User Capacity) などが簡単に分かります.

[image]

SMART に関する情報の取得

/dev/ad8」の部分は,扱いたいドライブ名にしてください.

/usr/local/sbin/smartctl -a /dev/ad8

■ 実行結果の例

/etc/periodic.conf と /usr/local/etc/smartd.conf の設定を行っていないときの実行例を,参考のために示しておく.

[image]

[image]