次のページ 前のページ 目次へ

3. ルートディレクトリを RAID にする方法の概説

復旧システムを試したり,構築したり,デバッグしたくない場合は, Slackware-3.4 に基づいて作った一般的なシステムを以下で入手してください.

ftp.bizsystems.com/pub/raid/raidboot-0.01.tar.gz
そして,次の手順を実行します.
  • 使用するディスクのサポートを組み込み,RAID を有効にしたカーネル を構築します
  • RAID アレイが正しく設定,マウントできるかテストします
  • RAID システム上に OS をインストールします
  • ルートデバイスとして /dev/md0 を参照するように fstab の内容を修正します.起動に必要なパーティションが fstab に含まれていることを確認します.
  • Modify your shutdown halt and reboot script(s) (mine is /etc/rc.d/rc.6) as shown in Modifying the rc-scripts for SHUTDOWN の記述にしたがって,マシンの停止及び再起動のスクリプト(筆者のシステム では /etc/rc.d/rc.6 です)を修正します.
  • 以下の手順に示すように,ファイルを作業用システムから,復旧システ ムと新しい RAID システムの両方にコピーします.
            cd /root/raidboot
            mkdir mnt
            gzip -d rescue.clean
            losetup /dev/loop0  rescue.clean
            mount /dev/loop0    mnt
    
    次のようにファイルをコピーします.
    
            cp -p /etc/*         mnt/etc
            cp -p /etc/rc.d/*    mnt/etc/rc.d 
                    {or as appropriate for your system}
            cp -a /lib/modules/* mnt/lib/modules 
    
    Linux のディストリビューションによっては,ルートファイルシステムの ro/rw ステータスを調べます.initrd 復旧システムの rc 起動 スクリプトからは,これを調べる部分を取り除く必要があります. 復旧システムの修正の章の手順を参照してくださ い.
devmd0/ がルートデバイスfstab になるよう fstab を修正し ます.起動に必要なパーティションが fstab に含まれていることを確認 しましょう.

RAID から起動する設定を記述する /etc/raidboot.conf を作成しま す.このファイルの最初の3行にはコメントを入れてはいけません.それ以降 ならば問題ありません.

raidboot.conf

        /dev/sda1 /dev/sda2
        raidboot
        raid5.conf
# comments may only be placed 'after' the three
# configuration lines.
#
# This is 'raidboot.conf'
#
# line one, the partition(s) containing the 'initrd' raid-rescue system
#       It is not necessary to boot from these partitions, however,
#       since the rescue system will not fit on floppy, it is necessary
#       to know which partitions are to be used to load the rescue system
#
# line two, the path to the raidboot config information
#       Where the shutdown status, etc... is located at boot time
#       It does NOT include the mount point information, only 'path'
#       /mntpoint/'path'
#
# line -3-, name of the raid configuration file
#       Current raid configuration file i.e. raid1.conf, raid5.conf
後はいくつかの作業を行えば,RAID システムの起動準備ができます.

付録 F で説明する, rc.raidown ファイルを # 作成し,これを復旧,作業,RAID の各システムの /etc/rc.d ディレクトリ # にコピーします.復旧システムをアンマウントした後,これを圧縮します.

        umount mnt
        losetup -d /dev/loop0
        mv rescue.clean rescue
        gzip rescue
復旧ファイルを RAID 起動パーティションにコピーします.
        cp rescue.gz /mnt_point(1)/raidboot
        cp rescue.gz /mnt_point(2)/raidboot
RAID アレイを有効にします.
        mdadd -ar
RAID 起動パーティションの 正しい 参照ステータスを保存します.
        cat /proc/mdstat | grep md0 > /mnt_point(1)/raidboot/raidgood.ref
        cat /proc/mdstat | grep md0 > /mnt_point(1)/raidboot/raidgood.ref
最後に 起動時の設定パラメータ の説明に 従って起動プログラムを設定し,RAID アレイ上のシステムを起動します.


次のページ 前のページ 目次へ

[