Update: Although the method described below does work, I eventually switched to Armbian’s Ubuntu 20.04 server image, and the ZFS DKMS module works there without any extra hacking.
I recently got a ROCKPro64 single-board computer that I’m planning to use as a home server. Once it arrived, I quickly discovered that setting up ZFS on it was going to be a bit tricky because there were issues building DKMS modules. After a few hours of troubleshooting, I finally figured it out, so I thought I’d write up what I did in hopes that it’ll help someone else get ZFS installed more easily.
I initially discovered a fairly involved way of getting it all to work (see “The Hard Way” below), but later I found an easier way (see “The Easy Way” below). I’d recommend starting with the easy way and only resorting to the hard way if that doesn’t work.
Both of these methods worked for me on ayufan’s minimal Debian Buster image running kernel 4.4.190-1233-rockchip-ayufan-gd3f1be0ed310
.
The easy way
- Delete
/usr/src/linux-headers-<version>/scripts/gcc-wrapper.py
. - Install
dksm
,spl-dkms
,zfs-dkms
, andzfsutils-linux
. - Load the zfs module -
modprobe zfs
.
I discovered this method thanks to this GitHub issue comment.
The hard way
Install
devscripts
andpython
.Install
dkms
andspl-dkms
. The latter will likely fail with errors about the DKMS build failing.cd
to/usr/src/linux-headers-4.4.190-1233-rockchip-ayufan-gd3f1be0ed310
and runmake scripts
. You may see some errors. If there is an error about missingclassmap.h
, you can comment out the line inscripts/Makefile
that ends with+= selinux
. I also saw some other errors about a few other headers missing fromtools/
. I fixed that by downloading the kernel source from ayufan’s repo and then copying the needed files fromtools/include/tools/
in the full kernel source totools/include/tools/
in the headers. Oncemake scripts
runs successfully, you can proceed.Edit
/var/lib/dkms/spl/<spl version>/source/configure
. There will be two instances of these lines:kuid_t userid = KUIDGT_INIT(0); kgid_t groupid = KGIDT_INIT(0);
Those can be deleted. There will also be two instances of these lines:
kuid_t userid = 0; kgid_t groupid = 0;
Remove the
= 0
part of both of those.Reinstall
spl-dkms
. It should succeed now.Install
zfs-dkms
andzfsutils-linux
.Load the zfs module -
modprobe zfs
.
I discovered this method thanks to this Github issue comment and this Armbian forum post.
Notes
Via the easy way, I tried installing dkms
, spl-dkms
, zfs-dkms
, and zfsutils-linux
all from the normal repo as well as from buster-backports
as the Debian docs on ZFS say to do. I only tried installing them from the normal repo when doing the hard way, but I would guess they would install from buster-backports
as well.