Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
FreeBSD 9.2 RELEASE を zfs boot でいれたときのメモ。installer から shell で入って、順次作業していく。
gpart create -s gpt da0
gpart add -s 64K -t freebsd-boot da0
gpart add -s 4G -t freebsd-swap -l swap0 da0
gpart add -t freebsd-zfs -l disk0 da0
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0
kldload /boot/kernel/opensolaris.ko
kldload /boot/kernel/zfs.ko
gnop create -S 4096 /dev/gpt/disk0
zpool create -o altroot=/mnt -O canmount=off -m none zroot /dev/gpt/disk0.nop
zfs set checksum=fletcher4 zroot
zfs set atime=off zroot
zfs create -o mountpoint=none zroot/ROOT
zfs create -o mountpoint=/ zroot/ROOT/default
zfs create -o mountpoint=/tmp -o compression=lz4 -o setuid=off zroot/tmp
chmod 1777 /mnt/tmp
zfs create -o mountpoint=/usr zroot/usr
zfs create zroot/usr/local
zfs create -o mountpoint=/home -o setuid=off zroot/home
zfs create -o compression=lz4 -o setuid=off zroot/usr/ports
zfs create -o compression=off -o exec=off -o setuid=off zroot/usr/ports/distfiles
zfs create -o compression=off -o exec=off -o setuid=off zroot/usr/ports/packages
zfs create -o compression=lz4 -o exec=off -o setuid=off zroot/usr/src
zfs create zroot/usr/obj
zfs create -o mountpoint=/var zroot/var
zfs create -o compression=lz4 -o exec=off -o setuid=off zroot/var/crash
zfs create -o exec=off -o setuid=off zroot/var/db
zfs create -o compression=lz4 -o exec=on -o setuid=off zroot/var/db/pkg
zfs create -o exec=off -o setuid=off zroot/var/empty
zfs create -o compression=lz4 -o exec=off -o setuid=off zroot/var/log
zfs create -o compression=gzip -o exec=off -o setuid=off zroot/var/mail
zfs create -o exec=off -o setuid=off zroot/var/run
zfs create -o compression=lz4 -o exec=on -o setuid=off zroot/var/tmp
chmod 1777 /mnt/var/tmp
# Set the dataset to boot from
zpool set bootfs=zroot/ROOT/default zroot
# cat << EOF > /tmp/bsdinstall_etc/fstab
# Device Mountpoint FStype Options Dump Pass#
/dev/gpt/swap0 none swap sw 0 0
/dev/gpt/swap1 none swap sw 0 0
EOF
---
packagesite: http://ftp.pcbsd.org/pub/mirror/packages/9.1-RELEASE/amd64/
PUBKEY: /usr/local/etc/pkg-pubkey.cert
PKG_CACHEDIR: /usr/local/tmp
sudo zfs create -o compression=gzip -o exec=on zroot/var/spool
sudo zfs create -o compression=gzip -o exec=off -o setuid=off zroot/var/spool/imap
# after install cyrus-imapd, execute commands
chown cyrus:cyrus /var/spool/imap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.