#contents
----------------------------

* ZFSインストール [#aa2cf66d]

*** GTP [#dc6f1e2e]
 csh
 kbdmap
 
 gpart create -s GPT ada0
 gpart add -t freebsd-boot -s 512K ada0
 
 gpart add -t freebsd-swap -s 2G ada0
 gpart add -t freebsd-zfs  -s 1T ada0
 gpart add -t freebsd-zfs  -s 1T ada0
 gpart add -t freebsd-zfs  -s 700G ada0
 gpart add -t freebsd-ufs  -i 9 ada0
 
 gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ada0
 
*** zpool作成 [#va39f2fd]
 zpool create -R /mnt -m none zroot ada0p3

***zfsデータセット作成 [#wddc857a]
 zfs create -o mountpoint=/ zroot/ROOT
 zfs create zroot/ROOT/ports
 zfs create zroot/ROOT/src
 
 zpool set bootfs=zroot/ROOT zroot
 
 mount /dev/da0 /media
 tar -xvzf /media/usr/freebsd-dist/base.txz -C /mnt
 tar -xvzf /media/usr/freebsd-dist/kernel.txz -C /mnt
 tar -zxvf /media/usr/freebsd-dist/src.txz -C /mnt
 echo 'zfs_load="YES"' >> /mnt/boot/loader.conf
 echo 'zfs_enable="YES"' >> /mnt/etc/rc.conf

-zfs snapshot -r zroot/ROOT@00
 
*** 再起動後に [#ma86723f]
 bsdconfig
 
 vi /etc/ssh/sshd_config
 
 #PermitRootLogin no
 PermitRootLogin yes

-zfs snapshot -r zroot/ROOT@01

*** ssh [#a6750d35]
 mount 192.168.0.144:/back /mnt
 cd $HOME
 mkdir .ssh
 cd .ssh
 cp /mnt/src/authorized_keys ./
 cp /mnt/src/id_dsa ./
 cp /mnt/src/id_rsa ./
 cd ../
 chown -R root .ssh
 chmod 700 .ssh
 chmod 600 .ssh/* 

*** hosts [#wb8ab317]
 cp /etc/hosts /etc/hosts.orig
 cat /mnt/src/hosts.txt >> /etc/hosts

*** resolv.conf [#y99b6890]
 cp /etc/resolv.conf /etc/resolv.conf.orig
 cp /mnt/src/resolv.conf /etc/resolv.conf

*** hosts.allow [#de314bea]
 mv /etc/hosts.allow /etc/hosts.allow.orig
 echo 'ALL : 127.0.0.1 : allow' >> /etc/hosts.allow
 echo 'ALL : 192.168. : allow' >> /etc/hosts.allow
 echo 'ALL : 125.53.25.128/255.255.255.192 : allow' >> /etc/hosts.allow
 echo 'ALL : ALL : deny' >> /etc/hosts.allow

*** inetd [#dc3ffe8b]
 cp /etc/rc.conf /etc/rc.conf.orig
 echo 'inetd_enable="YES"' >> /etc/rc.conf
 patch -p0 < /mnt/src/inetd.patch
 patch -p0 < /mnt/src/rsh.patch
 cp /mnt/src/rhosts.txt  /root/.rhosts

*** loader [#s8ea7315]
 echo 'hint.atkbd.0.flags="0x1"' >> /boot/loader.conf
 echo 'autoboot_delay="2"' >> /boot/loader.conf

*** ntp.conf [#t42ad47b]
 echo 'server ntp.jst.mfeed.ad.jp iburst' >> /etc/ntp.conf
 echo 'daily_ntpd_leapfile_enable="YES"' >> /etc/periodic.conf

*** ifconfig [#t8d0f064]
 
 vi /etc/rc.conf
 
 hostname="zfs.zenno.net"
 keymap="jp.106.kbd"
 ifconfig_rl0="inet 192.168.0.120 netmask 255.255.255.0"
 defaultrouter="192.168.0.140"
 sshd_enable="YES"
 inetd_enable="YES"
 ntpd_enable="YES"

*** etc [#dc8cdc14]
 pkg install -y rsync
 pkg install -y net-snmp
 pkg install -y smartmontools

 echo 'snmpd_enable="YES"' >> /etc/rc.conf
 cp /mnt/src/snmpd.conf  /usr/local/share/snmp

 mkdir /usr/local/scripts
 ln -s /usr/local/scripts /usr/local/src

 cp -p /mnt/src/auto_snap.sh /usr/local/scripts
 cp -p /mnt/src/hdd_temp.sh /usr/local/scripts
 echo '8 1 * * * /usr/local/scripts/auto_snap.sh' >> /var/cron/tabs/root

-zfs snap -r zroot/ROOT@02

*** zfs send [#lc937d4f]
 umount /mnt
 mount /dev/ada1p1 /mnt
 zfs send -vR zroot@02 > /mnt/20150522zfs/02.zfs

[[FreeBSD/インストール10.1_1]]
----
[[FreeBSD]]

[[FreeBSD/ZFSあれこれ]]

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS