ZFSインストール †
GTP †
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作成 †
zpool create -R /mnt -m none zroot ada0p3
zfsデータセット作成 †
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
再起動後に †
bsdconfig
vi /etc/ssh/sshd_config
#PermitRootLogin no
PermitRootLogin yes
- zfs snapshot -r zroot/ROOT@01
ssh †
mount 192.168.0.144:/back /mnt
cd $HOME
mkdir .ssh
cd .ssh
cp /mnt/src/authorized_keys ./
cp /mnt/src/id_rsa ./
cd ../
chown -R root .ssh
chmod 700 .ssh
chmod 600 .ssh/*
hosts †
cp /etc/hosts /etc/hosts.orig
cat /mnt/src/hosts.txt >> /etc/hosts
resolv.conf †
cp /etc/resolv.conf /etc/resolv.conf.orig
cp /mnt/src/resolv.conf /etc/resolv.conf
hosts.allow †
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 †
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 †
echo 'hint.atkbd.0.flags="0x1"' >> /boot/loader.conf
echo 'autoboot_delay="2"' >> /boot/loader.conf
ntp.conf †
echo 'server ntp.jst.mfeed.ad.jp iburst' >> /etc/ntp.conf
echo 'daily_ntpd_leapfile_enable="YES"' >> /etc/periodic.conf
ifconfig †
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 †
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 †
umount /mnt
mount /dev/ada1p1 /mnt
zfs send -vR zroot@02 > /mnt/20150522zfs/02.zfs
FreeBSD/インストール10.1_1
FreeBSD
FreeBSD/ZFSあれこれ