Created
July 4, 2012 04:00
-
-
Save bdrewery/3045195 to your computer and use it in GitHub Desktop.
FreeBSD BE ZFS setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| zfs_load="YES" | |
| vfs.root.mountfrom="zfs:zroot/ROOT/freebsd83" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| zfs_enable="YES" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gpart destroy -F ad1 | |
| gpart create -s gpt ad1 | |
| gpart add -s 128K -t freebsd-boot -l boot1 ad1 | |
| gpart add -s 8G -t freebsd-swap -l swap1 ad1 | |
| gpart add -t freebsd-zfs -l disk1 ad1 | |
| gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ad1 | |
| zpool create -f -o mountpoint=none -o cachefile=/tmp/zpool.cache zroot /dev/gpt/disk1 | |
| zfs set atime=off zroot | |
| zfs create zroot/ROOT | |
| mkdir /mnt/zfs | |
| zfs create -o mountpoint=/mnt/zfs zroot/ROOT/freebsd83 | |
| zfs create -o compression=on -o exec=off -o setuid=off -o com.sun:auto-snapshot=false zroot/ROOT/freebsd83/tmp | |
| chmod 1777 /mnt/zfs/tmp | |
| zfs create zroot/ROOT/freebsd83/usr | |
| zfs create -o compression=on -o com.sun:auto-snapshot=false zroot/ROOT/freebsd83/usr/obj | |
| zfs create zroot/export | |
| zfs create zroot/export/home | |
| zfs create -o compression=lzjb -setuid=off -exec=off -o com.sun:auto-snapshot=false zroot/ROOT/freebsd83/usr/src | |
| zfs create -o exec=off -o setuid=off -o compression=lzjb zroot/ROOT/freebsd83/usr/share | |
| zfs create zroot/ROOT/freebsd83/usr/jails | |
| zfs create zroot/ROOT/freebsd83/var | |
| zfs create -o compression=lzjb -o exec=off -o setuid=off -o com.sun:auto-snapshot=false zroot/ROOT/freebsd83/usr/dump | |
| zfs create -o exec=off -o setuid=off zroot/ROOT/freebsd83/var/db | |
| zfs create -o compression=lzjb -o exec=off -o setuid=off zroot/ROOT/freebsd83/var/db/pkg | |
| zfs create -o compression=lzjb -o exec=off -o setuid=off zroot/ROOT/freebsd83/var/log | |
| zfs create -o exec=off -o setuid=off zroot/ROOT/freebsd83/var/run | |
| zfs create -o readonly=on -o setuid=off -o exec=off zroot/ROOT/freebsd83/var/empty | |
| zfs create -o compression=lzjb -o exec=on -o setuid=off -o com.sun:auto-snapshot=false zroot/ROOT/freebsd83/var/tmp | |
| zfs create zroot/ROOT/freebsd83/usr/local | |
| zfs create -o compression=lzjb zroot/ROOT/freebsd83/usr/local/share | |
| zfs create -o setuid=off -o com.sun:auto-snapshot=false -o canmount=off zroot/ports | |
| zfs create -o compression=lzjb -o mountpoint=/usr/ports zroot/ports/checkout | |
| zfs create -o exec=off -o mountpoint=/var/db/portsnap zroot/ports/portsnap | |
| zfs create -o compression=gzip -o exec=off -o setuid=off -o mountpoint=/var/mail zroot/mail | |
| zfs create -o exec=off -o setuid=off -o compression=lzjb -o mountpoint=/usr/backup zroot/backup | |
| cp /tmp/zpool.cache /mnt/zfs/boot/zfs/ | |
| zfs unmount -a | |
| zpool set bootfs=zroot/ROOT/freebsd83 zroot | |
| zfs set mountpoint=legacy zroot/ROOT/freebsd83 | |
| zpool set cachefile='' zroot | |
| zfs set mountpoint=/usr/home zroot/export/home | |
| zfs set mountpoint=/usr/logs zroot/export/logs | |
| zfs set mountpoint=/usr/old zroot/export/old | |
| zfs set mountpoint=/usr zroot/ROOT/freebsd83/usr | |
| zfs set mountpoint=/var zroot/ROOT/freebsd83/var | |
| zfs set mountpoint=/tmp zroot/ROOT/freebsd83/tmp | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment