さいきんのOpensolarisでZFSにゃnfs鯖の作業手順
1st HDDにinst。最小9Gだが20Gくらいとっとく。
GUIで適度にIPとか変更。
以下の順に必要にゃ物だけ実行
cat /etc/nsswitch.dns > /etc/nsswitch.conf
ntpdate pool.ntp.org
pfexec pkg install SUNWipkg
pfexec pkg image-update
init 6
echo | format
0. c8t0d0 <DEFAULT cyl 290 alt 2 hd 255 sec 252>
1. c8t1d0 <DEFAULT cyl 291 alt 2 hd 255 sec 252>
2. c9t0d0 <DEFAULT cyl 291 alt 2 hd 255 sec 252>
3. c9t1d0 <DEFAULT cyl 291 alt 2 hd 255 sec 252>
4. c10t0d0 <DEFAULT cyl 291 alt 2 hd 255 sec 252>
5. c10t1d0 <DEFAULT cyl 291 alt 2 hd 255 sec 252>
format c8t1d0 fdisk create SOLARIS2 10GB(シリンダで指定)
format c9t0d0 fdisk create SOLARIS2 10GB(シリンダで指定)
format c9t1d0 fdisk create SOLARIS2 10GB(シリンダで指定)
format c10t0d0 fdisk create SOLARIS2 10GB(シリンダで指定)
format c10t1d0 fdisk create SOLARIS2 10GB(シリンダで指定)
但しHDDによってセクタ/シリンダとか違ってくるので違うHDD間でミラーする時は注意
format -e c8t1d0 label SMI
format -e c9t0d0 label SMI
format -e c9t1d0 label SMI
format -e c10t0d0 label SMI
format -e c10t1d0 label SMI
prtvtoc /dev/rdsk/c8t0d0s2 | fmthard -s - /dev/rdsk/c8t1d0s2
prtvtoc /dev/rdsk/c8t0d0s2 | fmthard -s - /dev/rdsk/c9t0d0s2
prtvtoc /dev/rdsk/c8t0d0s2 | fmthard -s - /dev/rdsk/c9t1d0s2
prtvtoc /dev/rdsk/c8t0d0s2 | fmthard -s - /dev/rdsk/c10t0d0s2
prtvtoc /dev/rdsk/c8t0d0s2 | fmthard -s - /dev/rdsk/c10t1d0s2
zpool attach -f rpool c8t0d0s0 c8t1d0s0
zpool attach -f rpool c8t0d0s0 c9t0d0s0
zpool attach -f rpool c8t0d0s0 c9t1d0s0
zpool attach -f rpool c8t0d0s0 c10t0d0s0
zpool attach -f rpool c8t0d0s0 c10t1d0s0
installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c8t1d0s0
installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c9t0d0s0
installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c9t1d0s0
installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c10t0d0s0
installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c10t1d0s0
zpool list
zpool status
format c8t0d0 fdisk create SOLARIS2 99%
format c8t1d0 fdisk create SOLARIS2 99%
format c9t0d0 fdisk create SOLARIS2 99%
format c9t1d0 fdisk create SOLARIS2 99%
format c10t0d0 fdisk create SOLARIS2 99%
format c10t1d0 fdisk create SOLARIS2 99%
zpool create pool1 raidz c8t0d0p2 c8t1d0p2 c9t0d0p2 c9t1d0p2 c10t0d0p2 c10t1d0p2
zfs create -o atime=off -o casesensitivity=mixed -o snapdir=visible -o aclinherit=passthrough pool1/share
zfs set compression=on pool1/share
zfs set recordsize=64k pool1/share
zfs set aclmode=passthrough pool1/share
zfs set sharenfs=on pool1/share
chmod 777 /pool1/share
vi hosts
share
echo set nfs:nfs_allow_preepoch_time = 1 >> /etc/system
echo set nfs:nfs3_max_threads = 32 >> /etc/system
echo set nfs:nfs3_nra = 32 >> /etc/system
echo set zfs:zfs_nocacheflush = 1 >> /etc/system
echo set zfs:zfs_txg_timeout = 5 >> /etc/system
echo set zfs:zil_disable = 1 >> /etc/system
crontab -e
0 4 * * * svcadm restart idmap
0 * * * * ntpdate pool.ntp.org
svcadm restart cron
pkg install SUNWsmbskr
pkg install SUNWsmbs
init 6
svcadm enable -r smb/server
vi resolv.conf
zfs set sharesmb=on pool1/share
zfs set sharesmb=name=share1 pool1/share
smbadm join -w WORKGROUP
echo other password required pam_smb_passwd.so.1 nowarn >> /etc/pam.conf
passwd 既存ユーザ(smbpasswd相当)
smbadm join -u domain_admin DOMAIN
svcadm disable smb/server
svcadm enable -r smb/server
chmod -R A=owner@:full_set:fd:allow /pool1/share
chmod -R A+group@:full_set:fd:allow /pool1/share
chmod -R A+everyone@:read_set:fd:allow /pool1/share
sharemgr show -vp
init 6
useradd -b /export/home/ -g staff -m -s /usr/bin/bash user1
vi /etc/auto_home
usermod -d /home/user1 user1
passwd user1
vi /etc/user_attr
vi /rpool/boot/grub/menu.lst
svcadm disable gdm
visudo
user1 ALL=(ALL) NOPASSWD: ALL
Defaults:user1 !env_reset
定期snapshotをcronに登録とか、mail送信用スクリプトを適当にゃ所にコピーとか、定期ディスク表面検査とか、ssh関連とかvisudoとか適時設定のこと。