差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
|
freebsd:001_020_proliant_microserver高機能nas化計画_osインストール編 [2011-10-19 01:16] Decomo |
freebsd:001_020_proliant_microserver高機能nas化計画_osインストール編 [2020-12-03 19:36] (現在) |
||
|---|---|---|---|
| 行 1: | 行 1: | ||
| ====== ProLiant MicroServer高機能NAS化計画(OSインストール編) ====== | ====== ProLiant MicroServer高機能NAS化計画(OSインストール編) ====== | ||
| + | |||
| + | ===== 環境 ===== | ||
| + | |||
| + | * HP ProLiant MicroServer | ||
| + | * FreeBSD 9.0-BETA3 | ||
| + | |||
| + | 詳細は[[pc: | ||
| ===== sshで入れるFixit環境の作成 ===== | ===== sshで入れるFixit環境の作成 ===== | ||
| === RAMディスクを作ってシステムをコピー === | === RAMディスクを作ってシステムをコピー === | ||
| - | |||
| <cli prompt="# | <cli prompt="# | ||
| - | # mdconfig -a -t malloc -s 2048M -u 10 | + | # umount |
| - | # newfs -U /dev/md10 | + | # mdmfs -s 2048m md1 /tmp |
| - | # mkdir /mdisk | + | # mkdir /tmp/dist |
| - | # mount /dev/md10 /mdisk | + | # find . ! -regex '\./tmp' | cpio -pd /tmp/dist |
| - | # cp -pR /dist /mdisk | + | |
| </ | </ | ||
| - | < | + | === コピーした環境へ入る === |
| - | umount /dev/md1 | + | |
| - | mdmfs -s 2048m md1 /tmp | + | |
| - | mkdir /tmp/dist | + | |
| - | find . ! -regex ' | + | |
| - | </ | + | |
| - | + | ||
| - | === 読み書き可能なFixit環境へ入る === | + | |
| <cli prompt="# | <cli prompt="# | ||
| - | # mount -t devfs devfs /mdisk/dist/dev | + | # mount -t devfs devfs /tmp/dist/dev |
| - | # chroot /mdisk/dist | + | # chroot /tmp/dist |
| </ | </ | ||
| 行 32: | 行 30: | ||
| === sshdの起動 === | === sshdの起動 === | ||
| - | |||
| <cli prompt="# | <cli prompt="# | ||
| # echo ' | # echo ' | ||
| 行 40: | 行 37: | ||
| === rootパスワードの設定 === | === rootパスワードの設定 === | ||
| - | |||
| <cli prompt="# | <cli prompt="# | ||
| # passwd | # passwd | ||
| 行 56: | 行 52: | ||
| # dd if=/ | # dd if=/ | ||
| </ | </ | ||
| - | |||
| === GPTを作成 === | === GPTを作成 === | ||
| 行 65: | 行 60: | ||
| === パーティション追加 === | === パーティション追加 === | ||
| - | freebsd-zfs領域をHDD目一杯まで使ってしまうと、HDD交換時に微妙な容量の差でRAIDが組めない事態が起こりうるので、最後の150Mは保険として未使用領域にする。 | + | freebsd-zfs領域をHDD目一杯まで使ってしまうと、HDD交換時に微妙な容量の差でRAIDが組めない事態が起こりうるので、保険として末尾100M(こんなに要らないだろうけど念のため)を未使用領域にする。 |
| <cli prompt="# | <cli prompt="# | ||
| - | # gpart add -b 40 -s 64k -t freebsd-boot ada0 # AFT対策としてセクタ40から使う | + | # gpart add -a 4k -s 64k -t freebsd-boot ada0 # AFT対策で-aで4kにアライメント |
| - | # gpart add -b 40 -s 64k -t freebsd-boot ada1 | + | # gpart add -a 4k -s 64k -t freebsd-boot ada1 |
| - | # gpart add -s 10g -t freebsd-swap -l swap0 ada0 | + | # gpart add -a 4k -s 10g -t freebsd-swap -l swap0 ada0 |
| - | # gpart add -s 10g -t freebsd-swap -l swap1 ada1 | + | # gpart add -a 4k -s 10g -t freebsd-swap -l swap1 ada1 |
| - | # gpart add -s 1443972647 -t freebsd-zfs ada0 | + | # gpart add -a 4k -s 1443972647 -t freebsd-zfs ada0 |
| - | # gpart add -s 1443972647 -t freebsd-zfs ada1 | + | # gpart add -a 4k -s 1443972647 -t freebsd-zfs ada1 |
| # gpart show | # gpart show | ||
| => | => | ||
| 行 91: | 行 86: | ||
| 20971688 | 20971688 | ||
| 1464944328 | 1464944328 | ||
| - | |||
| </ | </ | ||
| 行 100: | 行 94: | ||
| </ | </ | ||
| - | gnop create -S 4096 /dev/ada0p3 | + | === ZFSプールの作成 === |
| - | gnop create -S 4096 /dev/ada1p3 | + | ZFSを4kセクタに最適化するため、nopデバイス経由でプールを作成する。 |
| + | |||
| + | プール生成時に決定されるZFSの内部パラメータashiftが12になっていればよく、値決定後はnopでアクセスする必要はないらしい。 | ||
| + | 詳しくは[[http: | ||
| - | === ZFSプールの作成 === | ||
| <cli prompt="# | <cli prompt="# | ||
| + | # gnop create -S 4096 /dev/ada0p3 | ||
| + | # gnop create -S 4096 /dev/ada1p3 | ||
| # zpool create zroot mirror / | # zpool create zroot mirror / | ||
| - | </ | ||
| - | |||
| # zdb | # zdb | ||
| zroot: | zroot: | ||
| 行 128: | 行 124: | ||
| metaslab_array: | metaslab_array: | ||
| metaslab_shift: | metaslab_shift: | ||
| - | ashift: 12 | + | ashift: 12 ← ' |
| asize: 739309256704 | asize: 739309256704 | ||
| is_log: 0 | is_log: 0 | ||
| 行 148: | 行 144: | ||
| whole_disk: 1 | whole_disk: 1 | ||
| create_txg: 4 | create_txg: 4 | ||
| - | + | # zpool export zroot | |
| - | zpool export zroot | + | # gnop destroy / |
| - | gnop destroy / | + | # gnop destroy / |
| - | gnop destroy / | + | # zpool import zroot |
| - | zpool import zroot | + | </ |
| === ファイルシステムの作成と色々設定 === | === ファイルシステムの作成と色々設定 === | ||
| <cli prompt="# | <cli prompt="# | ||
| - | zfs set checksum=fletcher4 zroot | + | # zfs set checksum=fletcher4 zroot |
| - | zfs set compression=on zroot | + | # zfs set compression=on zroot |
| - | zfs create -o normalization=formC zroot/ | + | </ |
| - | zfs create -o exec=on -o setuid=off zroot/ | + | |
| - | chmod 1777 / | + | Macからのアクセスを考慮してNFCにする。 |
| + | <cli prompt="# | ||
| + | # zfs create -o normalization=formC zroot/ | ||
| + | </ | ||
| + | |||
| + | <cli prompt="# | ||
| + | # zfs create -o exec=on -o setuid=off zroot/ | ||
| + | # chmod 1777 / | ||
| - | zfs create zroot/ | + | # zfs create zroot/ |
| - | zfs create -o compression=gzip-9 zroot/ | + | # zfs create -o compression=gzip-9 zroot/ |
| - | zfs create -o compression=gzip-9 zroot/ | + | # zfs create -o compression=gzip-9 zroot/ |
| - | zfs create zroot/ | + | # zfs create zroot/ |
| - | cd / | + | # cd / |
| - | zfs create -o compression=gzip-9 -o setuid=off zroot/ | + | # 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 -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/ | + | # zfs create zroot/ |
| - | zfs create -o exec=off -o setuid=off -o compression=gzip-9 zroot/ | + | # zfs create -o exec=off -o setuid=off -o compression=gzip-9 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 -o compression=gzip-9 zroot/ | + | # zfs create -o exec=on -o setuid=off -o compression=gzip-9 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 -o compression=gzip-9 zroot/ | + | # zfs create -o exec=off -o setuid=off -o compression=gzip-9 zroot/ |
| - | zfs create -o exec=off -o setuid=off -o compression=gzip-9 zroot/ | + | # zfs create -o exec=off -o setuid=off -o compression=gzip-9 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 -o compression=gzip-9 zroot/ | + | # zfs create -o exec=on -o setuid=off -o compression=gzip-9 zroot/ |
| - | chmod 1777 / | + | # chmod 1777 / |
| - | zpool set bootfs=zroot/ | + | # zpool set bootfs=zroot/ |
| </ | </ | ||
| 行 193: | 行 196: | ||
| # for file in base.txz lib32.txz kernel.txz doc.txz ports.txz src.txz games.txz ; | # for file in base.txz lib32.txz kernel.txz doc.txz ports.txz src.txz games.txz ; | ||
| > do (cat $file | tar --unlink -xpvJf - -C ${DESTDIR: | > do (cat $file | tar --unlink -xpvJf - -C ${DESTDIR: | ||
| - | |||
| # zfs set readonly=on zroot/ | # zfs set readonly=on zroot/ | ||
| </ | </ | ||
| - | ===== chrootして初期設定 ==== | + | ===== chrootしてOSの初期設定 ==== |
| <cli prompt="# | <cli prompt="# | ||
| # mount -t devfs devfs / | # mount -t devfs devfs / | ||
| 行 203: | 行 205: | ||
| # / | # / | ||
| </ | </ | ||
| - | Configure | + | * Configure |
| - | > Root Password | + | |
| - | > Networking | + | * User Management |
| - | >> Interfaces | + | * User : ユーザーの追加 |
| - | > Time Zone | + | |
| + | * Select local or UTC (Greenwich Mean Time) clock : Yes (UTCで運用。JSTを使う場合はNo) | ||
| + | * Asia → Japan → Yes | ||
| + | * Networking | ||
| + | * Intarfaces | ||
| + | * bge0 | ||
| + | * IPv6 configuration : No | ||
| + | * DFCP configuration : No | ||
| + | * 設定 | ||
| + | * Bring up : No | ||
| === / | === / | ||
| 行 214: | 行 225: | ||
| opensolaris_load=" | opensolaris_load=" | ||
| zfs_load=" | zfs_load=" | ||
| - | vfs.root.mountfrom=" | + | vfs.root.mountfrom=" |
| cpufreq_load=" | cpufreq_load=" | ||
| vfs.zfs.txg.timeout=" | vfs.zfs.txg.timeout=" | ||
| 行 246: | 行 257: | ||
| EOF | EOF | ||
| </ | </ | ||
| - | |||
| === メールのエイリアスの生成 === | === メールのエイリアスの生成 === | ||
| 行 266: | 行 276: | ||
| # cp / | # cp / | ||
| </ | </ | ||
| - | |||
| ===== マウントポイントの設定 ===== | ===== マウントポイントの設定 ===== | ||
| 行 277: | 行 286: | ||
| # zfs set mountpoint=/ | # zfs set mountpoint=/ | ||
| </ | </ | ||
| - | |||
| ===== 後始末 ===== | ===== 後始末 ===== | ||
| 行 284: | 行 292: | ||
| # exit # sshから抜ける | # exit # sshから抜ける | ||
| </ | </ | ||
| - | |||
| - | ====== STABLEに更新 ====== | ||
| - | 8.2-RELEASEでAHCIを有効にすると、Marvellのチップを積んだSATAカードからのブートが「ROOT MOUNT ERROR」で失敗するため、STABLEに更新する(参考:[[http:// | ||
| - | この情報を見つけるまで、設定を変えたり何度も再インストールしたりと凄く苦労した・・・。 | ||
| - | |||
| - | 8.3-RELEASE以降では修正されると思われる。 | ||
| - | |||
| - | cp / | ||
| - | vi / | ||
| - | / | ||
| ====== 参考サイト ====== | ====== 参考サイト ====== | ||
| 行 304: | 行 302: | ||
| * [[http:// | * [[http:// | ||
| * [[http:// | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||