Howto build ZOL (ZFS On Linux) 0.8 from source in Devuan

(For ZOL version 0.7 see here)

Getting ZFS for Devuan was more difficult than I had expected, because

  • ZFS-fuse works, but is totally outdated and thus deprecated.
  • Installing package zfs-dkms 0.7.3 in Devuan 1 from backports contrib fails to configure
    (because it needs dkms version >, but Debian has
  • Installing zfs-dkms from contrib in Devuan 2 works like described here, but it is old version 6.5.9.
  • Update Sept 2019: I have not yet tested this suggestion from StackExchange, or this.
    Backports from Debian stretch now provide ZFS 0.7.12?

Thus I tried to compile from source, and succeeded with the following commands.
This goes the detour of creating deb packages, because installing directly somehow did not work. Maybe I made a mistake, maybe deb packets are really required, whatever, I document the method that worked.

This was tested

  • in Devuan 2.0 "ASCII" with ZOL 0.8.0, 0.8.1, 0.8.2, and 0.8.6

(for older ZOL versions see this)


# install prerequisites
# (from
aptitude install build-essential autoconf libtool gawk alien fakeroot
aptitude install zlib1g-dev uuid-dev libattr1-dev libblkid-dev libselinux-dev libudev-dev 
aptitude install parted lsscsi ksh libssl-dev libelf-dev
aptitude install linux-headers-$(uname -r)
# (from
aptitude install libaio-dev
# The following is only needed if you want to use pyzfs
# (if you do not install this, you later need to use `./configure --disable-pyzfs` to disable pyzfs)
aptitude install python3 python3-dev python3-setuptools python3-cffi

Note: linux-headers-$(uname -r) must be re-installed after kernel updates.

# import gpg-keys
# (info from
cd /usr/src
wget "" -O C6AF658B.key
gpg --import C6AF658B.key
wget "" -O D4598027.key
gpg --import D4598027.key

Update 2021-06-25: The keyservers and are offline. You can download the keys here: C6AF658B.key, D4598027.key.
But you should verify that their fingerprints are the same as on
(run the commands 'gpg C6AF658B.key' and 'gpg D4598027.key' to display them).

Download and Verify

cd /usr/local/src

# download source
# (URLs from

# verify (must say "good signature")
gpg --verify zfs-$version.sha256.asc
# extract
gpg zfs-$version.sha256.asc
# compare (must say "OK")
sha256sum -c zfs-$version.sha256


cd /usr/local/src

# extract
zcat zfs-$version.tar.gz | tar xf -

# make sure that the latest header files are installed (required after kernel-updates)
aptitude install linux-headers-$(uname -r)

# build zfs
cd /usr/local/src/zfs-$version
# (or `./configure --disable-pyzfs`, see the pyzfs comment above)
make -j $(nproc)
make -j1 deb


cd /usr/local/src

# install packages
dpkg -i zfs-$version/libzfs2_$version-1_amd64.deb
dpkg -i zfs-$version/zfs_$version-1_amd64.deb
dpkg -i zfs-$version/kmod-zfs-$(uname -r)_$version-1_amd64.deb
dpkg -i zfs-$version/libnvpair1_$version-1_amd64.deb
dpkg -i zfs-$version/libuutil1_$version-1_amd64.deb
dpkg -i zfs-$version/libzpool2_$version-1_amd64.deb

# load modules once
modprobe zfs

# automate loading of modules on each reboot
# (from
update-rc.d zfs-import defaults
update-rc.d zfs-mount defaults
update-rc.d zfs-zed defaults   # optional
update-rc.d zfs-share defaults # optional


mkdir /scratch
for i in {1..3}; do truncate -s 2G /scratch/$i.img; done
zpool create zpool raidz1 /scratch/{1..3}.img
zpool list
zpool status
zfs list

Looks good so far. Even /etc/zfs/vdev_id.conf works (after udevadm trigger, albeit not with the /scratch/images).

Update to later version

First unmount the zfs-filesystems

zfs umount zpool

Then uninstall the old version:

dpkg -r zfs libzfs2 kmod-zfs-$(uname -r)
dpkg -r libnvpair1 libuutil1 libzpool2

If you installed a new kernel: reinstall the headers package

aptitude install linux-headers-$(uname -r)

Finally recompile and reinstall zfs like above.
Note: if you keep using the same version of zfs: run "make clean" before "./configure".

Add download for gpg-keys, because the keyservers are offline
version 0.8.6 is signed with a different gpg-key
libzfs2 must be installed before zfs
version 0.8 has spl included, is signed with different gpg-key, needs python-dev (or the option --disable-pyzfs), and libelf-dev?, and libaio-dev?, ...
("configure: error: "Python >= '3.4.0' development library is not installed")
tested version 0.7.13 in Devuan 2.0
tested version 0.7.9 in Devuan 2.0
added gpg check
re-inserted commands "make -j $(nproc)" because "Missing spl symbols", "RPM build errors"
tested in Devuan 2.0 beta
tested version 0.7.6.
version 0.7.3 hardcoded → $version 0.7.5 variable
added dpkg -i kmod-spl & kmod-zfs
added update-rc.d commands