On ubuntu based systems after 16.04 it's enough to run
apt install zfsutils-linux
for zfs support to be installed.
The same as Ubuntu.
https://github.com/zfsonlinux/zfs/wiki/RHEL-and-CentOS
Add module to autoload by creating file /etc/modules-load.d/zfs.conf with content
zfs
zpool create -o ashift=12 -m <mountpoint> <pool-name> <device1> <device2>
zpool create -o ashift=12 -m <mountpoint> <pool-name> mirror <device1> <device2>
zpool create -o ashift=12 -m <mountpoint> <pool-name> raidz <device1> <device2> <device3>
Please note you should match current pool type for accurate redundancy.
zpool add <pool-name> mirror|raidz(2,3)|none <device(s)>
zpool status <pool-name>
zpool destroy <pool-name>
zpool list
This is a two step process. First the pool must be exported, then imported to a new name.
zpool export <pool-name> zpool import <pool-name> <new-pool-name>
Typically after re-installing the OS the datadrive (zfs) needs to be imported. Again this is a two step process.
zpool import
will list the zfs pools that it can find. Then it's just a matter of running
zpool import -f <pool-name>
to import the pool and mount the datasets.
Make sure to use by-id or similar for import as device naming (sd*) can change.
zpool import -f -d /dev/disk/by-id <pool-name>
or filesystems, as some call them
zfs create -o mountpoint=<mountpoint> <pool-name>/<dataset>
zfs destroy <pool-name>/<dataset>
zfs set quota=xxG <pool-name>/<dataset>
zfs snapshot -r <pool-name>/<dataset>@<snapshot-name>
zfs list -t snapshot
zfs rollback <pool-name>/<dataset>@<snapshot-name>
zfs destroy <pool-name>/<dataset>@<snapshot-name>
for snapshot in `zfs list -H -t snapshot -r <pool>|cut -f 1`; do zfs destroy $snapshot; done
ZFS installation problems on KDE Neon (16.04).
$ zpool status The ZFS modules are not loaded. Try running '/sbin/modprobe zfs' as root to load them.
$ /sbin/modprobe zfs modprobe: ERROR: could not insert 'zfs': Unknown symbol in module, or unknown parameter (see dmesg)
It seems there is a problem on a fresh install of KDE Neon (16.04) where the kernel installed is not the same as the kernel headers. My only solution was to remove all zfs and kernel related packages and reinstall the following packages
linux-headers-generic linux-image-generic zfsutils-linux