How to install ZFSonLinux (DKMS) on Arch. Using the Dynamic Kernel Module Support version means the ZFS modules will be rebuilt automatically after every kernel upgrade. See the steps in the Upgrading section if this automatic build fails.
Much like the Build Arch Packages guide, we'll need the base-devel group to build the packages required for ZFS.
pacman -S base-devel git
DO NOT PERFORM THESE STEPS AS ROOT. Building packages as root could lead to unforseen consequences.
First we'll need the Solaris Porting Layer kernel modules so ZFS has what it needs to operate. Grab the DKMS version.
mkdir -p ~/build/ cd ~/build/ git clone https://aur.archlinux.org/spl-dkms.git cd spl-dkms makepkg -si
This will build and install the latest version of the spl-dkms package.
ZFS utility packages
Now that the SPL is in place, we can install the ZFS utilities.
cd ~/build/ git clone https://aur.archlinux.org/zfs-utils.git cd zfs-utils makepkg -si
This will build and install the latest version of the zfs-utils package.
Once the ZFS utilities are in place the last bit to install is ZFS itself. Grab the DKMS version.
cd ~/build/ git clone https://aur.archlinux.org/zfs-dkms.git cd zfs-dkms makepkg -si
This will build and install the latest version of the zfs-dkms package. The kernel module will be generated upon install and each time the kernel is updated. Make sure to check for kernel incompatibilities with the zfs-dkms package before updating between major versions of the Linux kernel.
Minor kernel updates shouldn't require a rebuild of ZFS or SPL packages. In cases where it is required though, uninstall the packages first.
sudo pacman -R spl-dkms zfs-utils zfs-dkms
Then upgrade the system
sudo pacman -Syu
Then go through the Install steps listed above before rebooting. Failure to reinstall ZFS before rebooting will render any ZFS volumes inoperable, but they will continue to function properly while the packages are uninstalled until you reboot.