差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
|
freebsd:001_020_proliant_microserver高機能nas化計画_osインストール編 [2011-11-03 11:23] Decomo |
freebsd:001_020_proliant_microserver高機能nas化計画_osインストール編 [2020-12-03 19:36] (現在) |
||
|---|---|---|---|
| 行 6: | 行 6: | ||
| * FreeBSD 9.0-BETA3 | * FreeBSD 9.0-BETA3 | ||
| - | 詳細は[[pc: | + | 詳細は[[pc: |
| ===== sshで入れるFixit環境の作成 ===== | ===== sshで入れるFixit環境の作成 ===== | ||
| 行 26: | 行 26: | ||
| === ネットワークの設定 === | === ネットワークの設定 === | ||
| <cli prompt="# | <cli prompt="# | ||
| - | ifconfig bge0 192.168.65.1 netmask 255.255.255.0 | + | # ifconfig bge0 192.168.65.1 netmask 255.255.255.0 |
| - | </code> | + | </cli> |
| === sshdの起動 === | === sshdの起動 === | ||
| - | <code bash> | + | <cli prompt="# |
| - | echo ' | + | # echo ' |
| - | echo ' | + | # echo ' |
| - | / | + | # / |
| - | </code> | + | </cli> |
| === rootパスワードの設定 === | === rootパスワードの設定 === | ||
| 行 52: | 行 52: | ||
| # dd if=/ | # dd if=/ | ||
| </ | </ | ||
| - | |||
| === GPTを作成 === | === GPTを作成 === | ||
| 行 61: | 行 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 | ||
| => | => | ||
| 行 87: | 行 86: | ||
| 20971688 | 20971688 | ||
| 1464944328 | 1464944328 | ||
| - | |||
| </ | </ | ||
| 行 96: | 行 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: | ||
| 行 124: | 行 124: | ||
| metaslab_array: | metaslab_array: | ||
| metaslab_shift: | metaslab_shift: | ||
| - | ashift: 12 | + | ashift: 12 ← ' |
| asize: 739309256704 | asize: 739309256704 | ||
| is_log: 0 | is_log: 0 | ||
| 行 144: | 行 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/ | + | </cli> |
| - | zfs create -o exec=on -o setuid=off zroot/ | + | |
| - | chmod 1777 /zroot/ROOT/tmp | + | |
| - | zfs create zroot/ | + | Macからのアクセスを考慮してNFCにする。 |
| - | zfs create -o compression=gzip-9 zroot/ | + | <cli prompt="# "> |
| - | zfs create -o compression=gzip-9 | + | # zfs create -o normalization=formC zroot/ |
| - | zfs create zroot/ | + | </cli> |
| - | cd / | + | <cli prompt="# "> |
| - | zfs create -o compression=gzip-9 -o setuid=off zroot/ | + | # zfs create -o exec=on -o setuid=off zroot/ROOT/tmp |
| - | zfs create | + | # chmod 1777 / |
| - | zfs create -o compression=off -o exec=off -o setuid=off | + | |
| - | zfs create zroot/ROOT/var | + | # zfs create zroot/ROOT/usr |
| - | zfs create | + | # zfs create -o compression=gzip-9 zroot/ROOT/usr/include |
| - | zfs create | + | # zfs create -o compression=gzip-9 zroot/ROOT/usr/src |
| - | zfs create -o exec=on -o setuid=off | + | # zfs create zroot/ROOT/usr/home |
| - | zfs create | + | |
| - | 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=on -o setuid=off -o compression=gzip-9 zroot/ | + | |
| - | chmod 1777 /zroot/ROOT/var/tmp | + | |
| - | zpool set bootfs=zroot/ | + | # cd / |
| + | # 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/ | ||
| + | # 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=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 -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=on -o setuid=off -o compression=gzip-9 zroot/ | ||
| + | # chmod 1777 / | ||
| + | |||
| + | # zpool set bootfs=zroot/ | ||
| </ | </ | ||
| 行 189: | 行 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 / | ||
| 行 199: | 行 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 | ||
| === / | === / | ||
| 行 210: | 行 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=" | ||
| 行 242: | 行 257: | ||
| EOF | EOF | ||
| </ | </ | ||
| - | |||
| === メールのエイリアスの生成 === | === メールのエイリアスの生成 === | ||
| 行 262: | 行 276: | ||
| # cp / | # cp / | ||
| </ | </ | ||
| - | |||
| ===== マウントポイントの設定 ===== | ===== マウントポイントの設定 ===== | ||
| 行 273: | 行 286: | ||
| # zfs set mountpoint=/ | # zfs set mountpoint=/ | ||
| </ | </ | ||
| - | |||
| ===== 後始末 ===== | ===== 後始末 ===== | ||
| 行 280: | 行 292: | ||
| # exit # sshから抜ける | # exit # sshから抜ける | ||
| </ | </ | ||
| - | |||
| - | ====== STABLEに更新 ====== | ||
| - | 8.2-RELEASEでAHCIを有効にすると、Marvellのチップを積んだSATAカードからのブートが「ROOT MOUNT ERROR」で失敗するため、STABLEに更新する(参考:[[http:// | ||
| - | この情報を見つけるまで、設定を変えたり何度も再インストールしたりと凄く苦労した・・・。 | ||
| - | |||
| - | 8.3-RELEASE以降では修正されると思われる。 | ||
| - | |||
| - | cp / | ||
| - | vi / | ||
| - | / | ||
| ====== 参考サイト ====== | ====== 参考サイト ====== | ||
| 行 300: | 行 302: | ||
| * [[http:// | * [[http:// | ||
| * [[http:// | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||