Install/Update ZFS

From Mage
Jump to: navigation, search

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.

Build environment

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

group details - base-devel

package details - git


DO NOT PERFORM THESE STEPS AS ROOT. Building packages as root could lead to unforseen consequences.

SPL packages

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
cd spl-dkms
makepkg -si

This will build and install the latest version of the spl-dkms package.

package details - spl-dkms

ZFS utility packages

Now that the SPL is in place, we can install the ZFS utilities.

cd ~/build/
git clone
cd zfs-utils
makepkg -si

This will build and install the latest version of the zfs-utils package.

package details - zfs-utils

ZFS packages

Once the ZFS utilities are in place the last bit to install is ZFS itself. Grab the DKMS version.

cd ~/build/
git clone
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.

package details - zfs-dkms


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.