Ubuntu Xenial included ZFS by default. But for those that adventureous and seeking new features, use a ZFS on Linux (ZoL) fresh from GIT.

Removing the old

Unload Kernel

sudo rmmod zfs
sudo rmmod spl

Just make sure they are not in use. No ZFS pool activated.

Removing old driver

Remove the old from default kernel:

rm -rf /lib/modules/$(uname -r)/kernel/zfs/

Dependencies

apt -y install build-essential autoconf libtool gawk alien fakeroot linux-headers-$(uname -r)
apt -y install zlib1g-dev uuid-dev libattr1-dev libblkid-dev libselinux-dev libudev-dev
apt -y install parted lsscsi ksh
apt -y install autoconf git libdevmapper-dev

ZFS

We just want the kernel because the userspace tool from Ubuntu is sufficient for now.

Let’s download the sources:

git clone https://github.com/zfsonlinux/spl
git clone https://github.com/zfsonlinux/zfs

SPL Kernel

Go:

cd spl

Do the stanza:

./autogen.sh
./configure --prefix=/usr --with-config=kernel
make -j$(nproc)
sudo make install

ZFS Kernel

Go:

cd ../zfs

Do the stanza:

./autogen.sh
./configure --prefix=/usr --with-config=kernel
make -j$(nproc)
sudo make install

Done

We can restart for better, or we can reload:

sudo modprobe zfs

IFs

Sometimes life gives you lemon, find out what’s wrong with making sure that you are loading the right kernel

sudo modinfo zfs

This made me frustrated in the past. I just realized at some point that the kernel was still in bed with the old ZFS kernel module.