さいきんのOpensolarisでZFSにゃnfs鯖の作業手順 更新版
1st HDDにinst。最小9Gだが20G〜30Gくらいとっとく。
GUIが有れば適度にIPとか変更。
以下の順に必要にゃ物だけ実行
dladm show-ether
dladm show-link
ifconfig nic0 plumb
ifconfig -a
echo 123.123.123.123>/etc/hostname.nic0
echo 123.123.123.123 255.255.0.0>>/etc/netmasks
echo 123.123.123.1>/etc/defaultrouter
echo hostname>/etc/nodename
echo domain local>/etc/resolv.conf
echo nameserver 123.123.123.1>>/etc/resolv.conf
svcadm disable svc:/network/physical:nwam
svcadm enable svc:/network/physical:default
cat /etc/nsswitch.dns > /etc/nsswitch.conf
ifconfig -a
init 6
ping 123.123.123.123
ping yahoo.com
ntpdate pool.ntp.org
pfexec pkg install SUNWipkg
pfexec pkg image-update
init 6
pfexec pkg image-update
init 6
pfexec pkg image-update
init 6
zpool upgrade rpool
zfs upgrade -r rpool
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>
format c8t1d0 fdisk create SOLARIS2 10GB(シリンダで1stディスクと似たようにゃ感じに指定)
format c9t0d0 fdisk create SOLARIS2 10GB(シリンダで1stディスクと似たようにゃ感じに指定)
format c9t1d0 fdisk create SOLARIS2 10GB(シリンダで1stディスクと似たようにゃ感じに指定)
但しHDDによってセクタ/シリンダとか違ってくるので違うHDD間でミラーする時は注意
format -e c8t1d0 label SMI
format -e c9t0d0 label SMI
format -e c9t1d0 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
zpool attach -f rpool c8t0d0s0 c8t1d0s0
zpool attach -f rpool c8t0d0s0 c9t0d0s0
zpool attach -f rpool c8t0d0s0 c9t1d0s0
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
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%
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 /etc/hosts
share
echo set nfs:nfs_allow_preepoch_time = 1 >> /etc/system
echo set nfs:nfs3_max_threads = 1024 >> /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:zfs_scrub_delay = 100 >> /etc/system
echo set zfs:zfs_scrub_limit = 1 >> /etc/system
echo set zfs:zil_disable = 1 >> /etc/system
echo set zfs:zfs_vdev_max_pending = 10 >> /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
mkdir -p /vmfs/volumes
cd /vmfs/volumes/
host=`cat /etc/nodename`
ln -s /pool1/share/ ds_$host
ssh-keygen -t rsa
cd
cd .ssh
vi authorized_keys
dladm show-ether
dladm show-link
ifconfig -a
ifconfig nic1 plumb
ifconfig nic2 plumb
dladm create-aggr -l nic1 aggr1
dladm add-aggr -l nic2 aggr1
ifconfig aggr1 plumb
ifconfig aggr1 123.123.123.124 netmask 255.255.0.0 up
ifconfig nic0 down
dladm add-aggr -l nic0 aggr1
dladm show-aggr
cp /etc/hostname.nic1 /etc/hostname.aggr1
dladm modify-aggr -P L2,L3,L4 aggr1
dladm modify-aggr -l passive aggr1
dladm show-aggr -L
dladm show-aggr -x
init 6
定期snapshotをcronに登録とか、mail送信用スクリプトを適当にゃ所にコピーとか、定期ディスク表面検査とか、ssh関連とかvisudoとか適時設定のこと。