Start installation FreeBSD, and on the allocation disk step, choose Shell.

List disk on system.

# sysctl -a | grep disk

I have vtbd0.

Check GPT table.

# gpart show

If exists, delete it.

# gpart destory -F vtbd0

Begin allocation.

# gpart create -s gpt vtbd0 # gpart add -t freebsd-boot -s 512 vtbd0 # gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 vtbd0 # gpart add -t freebsd-swap -s 512M vtbd0 # gpart add -t freebsd-zfs vtbd0

Create zfs pool with name example.

# zpool create -m /mnt example /dev/vtbd0p3

If errors occur like ZFS NOTICE, ZFS WARNING, ignor it.

See zfs pool.

# zpool list

Create filesystems.

# zfs create example/var # zfs create example/usr # zfs create example/tmp

List partitions.

# df -h

Finish setup.

# exit

After reboot, go to shell and do this settings.

# echo 'zfs_enable="YES"' >> /etc/rc.conf # echo 'vfs.zfs.prefetch_disable=0' >> /boot.loader.conf # echo 'vm.kmem_size=330M' >> /boot.loader.conf # echo 'vm.kmem_size_max=330M' >> /boot.loader.conf

Add swap.

# vi /etc/fstab


/dev/vtbd0p2 none swap sw 0 0

Reboot in Single USer Mode (number 2 on booting).

Load zfs pool.

# zpool import -f example

See, that it exists.

# zpool list

List partitions.

# df -h

Now, partitons mounted on /mnt, fix it.

# zfs umount -a # zfs set moutpoint=legacy example # zfs set moutpoint=/var example/var # zfs set moutpoint=/usr example/usr # zfs set moutpoint=/tmp example/tmp

Poweroff server, eject cd or iso file, and power on server.

See partitions and zfs pool.

# df -h # zpool list

Zfs pool healthy state.

# zpool status -x

 Create snapshot tmp partition (as an example).

# zfs snapshot example/tmp@14-02-17

List snapshots.

# zfs list -t snapshot

Restore tmp partition from snapshot.

# zfs rollback example/tmp@14-02-17