差分
このページの2つのバージョン間の差分を表示します。
次のリビジョン | 前のリビジョン | ||
freebsd:001_020_proliant_microserver高機能nas化計画_osインストール編 [2011-09-17 11:01] Decomo 作成 |
freebsd:001_020_proliant_microserver高機能nas化計画_osインストール編 [2020-12-03 19:36] |
||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== ProLiant MicroServer高機能NAS化計画(OSインストール編) ====== | ||
- | |||
- | ===== sshで入れるFixit環境の作成 ===== | ||
- | |||
- | === RAMディスクを作ってシステムをコピー === | ||
- | |||
- | <cli> | ||
- | # mdconfig -a -t malloc -s 2048M -u 10 | ||
- | # newfs -U /dev/md10 | ||
- | # mkdir /mdisk | ||
- | # mount /dev/md10 /mdisk | ||
- | # cp -pR /dist /mdisk | ||
- | </ | ||
- | |||
- | === 読み書き可能なFixit環境へ入る === | ||
- | |||
- | <cli> | ||
- | # mount -t devfs devfs / | ||
- | # chroot /mdisk/dist | ||
- | </ | ||
- | |||
- | === ネットワークの設定 === | ||
- | |||
- | <cli> | ||
- | # ifconfig bge0 192.168.65.1 netmask 255.255.255.0 | ||
- | </ | ||
- | |||
- | === sshdの起動 === | ||
- | |||
- | <cli> | ||
- | # echo ' | ||
- | # echo ' | ||
- | # / | ||
- | </ | ||
- | |||
- | === rootパスワードの設定 === | ||
- | |||
- | <cli> | ||
- | # passwd | ||
- | Changing local password for root | ||
- | New Password: ******** | ||
- | Retype New Password: ******** | ||
- | </ | ||
- | | ||
- | ===== ZFSファイルシステムの作成 ===== | ||
- | |||
- | === パーティションテーブル初期化 === | ||
- | 本来はgpart destroyで消すべきだが、面倒なので… | ||
- | <cli> | ||
- | # dd if=/ | ||
- | # dd if=/ | ||
- | </ | ||
- | |||
- | |||
- | === GPTを作成 === | ||
- | <cli> | ||
- | # gpart create -s gpt ada0 | ||
- | # gpart create -s gpt ada1 | ||
- | </ | ||
- | |||
- | === パーティション追加 === | ||
- | freebsd-zfs領域をHDD目一杯まで使ってしまうと、HDD交換時に微妙な容量の差でRAIDが組めなくなる事が起こりうるので、最後の150Mは保険として未使用領域にする。 | ||
- | <cli> | ||
- | # gpart add -b 40 -s 64k -t freebsd-boot ada0 # AFT対策としてセクタ40から使う | ||
- | # gpart add -b 40 -s 64k -t freebsd-boot ada1 | ||
- | # gpart add -s 10g -t freebsd-swap -l swap0 ada0 | ||
- | # gpart add -s 10g -t freebsd-swap -l swap1 ada1 | ||
- | # gpart add -s 1443870247 -t freebsd-zfs -l boot0a ada0 | ||
- | # gpart add -s 1443870247 -t freebsd-zfs -l boot0b ada1 | ||
- | # gpart show | ||
- | => 34 1465149101 | ||
- | 34 | ||
- | 40 | ||
- | | ||
- | 20971688 | ||
- | 1464841935 | ||
- | |||
- | => 34 1465149101 | ||
- | 34 | ||
- | 40 | ||
- | | ||
- | 20971688 | ||
- | 1464841935 | ||
- | </ | ||
- | |||
- | |||
- | 1465149168 | ||
- | WDC WD20EARX-00PASB0 3907029168セクタ=1862.6963GiB | ||
- | Hitachi HDS722020ALA330 3907029168セクタ=1863.0166GiB | ||
- | |||
- | ブートコード書き込み | ||
- | gpart bootcode -b /boot/pmbr -p / | ||
- | gpart bootcode -b /boot/pmbr -p / | ||
- | |||
- | ZFSカーネルモジュールの読込み | ||
- | kldload / | ||
- | # kldload / | ||
- | |||
- | Create ZFS Pool zroot | ||
- | zpool create zroot mirror / | ||
- | zpool set bootfs=zroot zroot | ||
- | |||
- | zfs set checksum=fletcher4 zroot | ||
- | zfs set compression=on zroot | ||
- | zfs create -o exec=on -o setuid=off zroot/tmp | ||
- | chmod 1777 /zroot/tmp | ||
- | |||
- | zfs create zroot/usr | ||
- | zfs create -o compression=gzip-9 zroot/ | ||
- | zfs create -o compression=gzip-9 zroot/ | ||
- | zfs create zroot/ | ||
- | cd /zroot; ln -s /usr/home home | ||
- | |||
- | zfs create -o compression=gzip-9 -o setuid=off zroot/ | ||
- | zfs create -o compression=off -o exec=off -o setuid=off zroot/ | ||
- | zfs create -o compression=off -o exec=off -o setuid=off zroot/ | ||
- | |||
- | zfs create zroot/var | ||
- | zfs create -o exec=off -o setuid=off zroot/ | ||
- | zfs create -o exec=off -o setuid=off zroot/ | ||
- | zfs create -o exec=on -o setuid=off zroot/ | ||
- | zfs create -o exec=off -o setuid=off zroot/ | ||
- | zfs create -o exec=off -o setuid=off zroot/ | ||
- | zfs create -o exec=off -o setuid=off zroot/ | ||
- | zfs create -o exec=off -o setuid=off zroot/ | ||
- | zfs create -o exec=on -o setuid=off zroot/ | ||
- | chmod 1777 / | ||
- | |||
- | cd / | ||
- | sh | ||
- | cd / | ||
- | export DESTDIR=/ | ||
- | # for dir in base catpages dict doc games info lib32 manpages ports; do (cd $dir ; ./ | ||
- | You are about to extract the base distribution into /zroot - are you SURE | ||
- | you want to do this over your installed system (y/n)? y | ||
- | You are about to extract the doc distribution into /zroot - are you SURE | ||
- | you want to do this over your installed system (y/n)? y | ||
- | Extracting ports tarball into /usr | ||
- | |||
- | cd src ; ./ | ||
- | cd ../kernels ; ./ | ||
- | cd /zroot/boot ; cp -Rlp GENERIC/* / | ||
- | |||
- | zfs set readonly=on zroot/ | ||
- | |||
- | mount -t devfs devfs /zroot/dev | ||
- | chroot /zroot | ||
- | / | ||
- | |||
- | Configure | ||
- | > Root Password | ||
- | > Networking | ||
- | > Time Zone | ||
- | |||
- | cat << EOF > / | ||
- | ahci_load=" | ||
- | opensolaris_load=" | ||
- | zfs_load=" | ||
- | vfs.root.mountfrom=" | ||
- | cpufreq_load=" | ||
- | vfs.zfs.txg.timeout=" | ||
- | |||
- | kern.maxusers=512 | ||
- | vm.kmem_size=" | ||
- | vm.kmem_size_max=" | ||
- | vfs.zfs.arc_min=" | ||
- | vfs.zfs.arc_max=" | ||
- | EOF | ||
- | |||
- | cat << EOF >> / | ||
- | zfs_enable=" | ||
- | powerd_enable=" | ||
- | powerd_flags=" | ||
- | cpufreq_load=" | ||
- | |||
- | sshd_enable=" | ||
- | EOF | ||
- | |||
- | cd /etc/mail | ||
- | make aliases | ||
- | |||
- | exit | ||
- | umount /zroot/dev | ||
- | |||
- | cd / | ||
- | zpool export zroot && zpool import zroot | ||
- | cp / | ||
- | |||
- | cat << EOF > / | ||
- | # Device | ||
- | / | ||
- | / | ||
- | EOF | ||
- | |||
- | # export LD_LIBRARY_PATH=/ | ||
- | # zfs unmount -a | ||
- | |||
- | zfs set mountpoint=legacy zroot | ||
- | zfs set mountpoint=/ | ||
- | zfs set mountpoint=/ | ||
- | zfs set mountpoint=/ | ||
- | |||
- | |||
- | shから抜ける | ||
- | exit | ||
- | |||
- | sshから抜ける | ||
- | exit | ||
- | |||
- | ====== STABLEに更新 ====== | ||
- | cp / | ||
- | vi / | ||
- | / | ||
- | |||
- | ====== 参考サイト ====== | ||
- | * [[http:// | ||
- | * [[http:// | ||
- | * [[http:// | ||
- | * [[http:// | ||
- | * [[http:// | ||
- | * [[http:// | ||
- | * [[http:// | ||