Some notes on ZFS pools & datasets on FreeBSD
zpool create <pool name> <device name>
For example, create a pool called zfs-pool
on disk device /dev/da2
:
zpool create zfs-pool /dev/da2
zfs create <pool name>/<dataset name>
For example, create a dataset called dataset
in the ZFS Pool zfs-pool
created above
zfs create zfs-pool/dataset
This will set the mountpoint for either a ZFS Pool or Dataset, depending upon the target
zfs set mountpoint=</path/to/mountpoint> <zfs pool>/<zfs dataset>
For example, to mount the dataset called dataset
in the ZFS Pool zfs-pool
at /mnt/dataset
zfs set mountpoint=/mnt/dataset zfs-pool/dataset
This will set the compression type for either a ZFS Pool or Dataset, depending upon the target
zfs set compression=<compression type> <zfs pool>/<zfs dataset>
Compression type can be one of:
Which is best for you varies, but for general purpose I find lz4 the best option
For example, to set lz4 compression on the whole pool zfs-pool
created above, use:
zfs set compression=lz4 zfs-pool
Alternatively, to set gzip compression specifically on the dataset
dataset' use:
zfs set compression=gzip zfs-pool/dataset