ZFS Commands
See Oracle's Documentation Guide for more detailed information and examples.
Pools and vDevs
Create a mirror pool
Create a new pool called new-pool using the devices /dev/sdb and /dev/sdc in a mirror
You can also use the-m
option to specify the mount point. The default mount point is /poolname
Checking the status of all zfs pools
Add devices to an existing ZFS pool
Add the devices /dev/sdb and /dev/sdc to the pool called existing-pool
Datasets
Create a new dataset
Create a dataset named 'mydataset' on the pool 'mypool'
Check the dataset seize
Set additional properties
sudo zfs set compression=on mypool/mydataset # turns on compression
sudo zfs set quota=10G mypool/mydataset # set the sixe quota to 10GB
sudo zfs get quota /mypool/mydataset # view the quota of the dataset
sudo zfs set canmount=on and mountpoint=/mount/point mypool/mydataset # these two options mount the dataset at boot