I installed Ubuntu 20.10 on a new machine with the ZFS option, i. e. both /boot
and the root file system are on ZFS. However, I need the newer kernel version 5.9 for hardware support, which I installed using the mainline kernel PPA. Unfortunately, the version of ZFS included in Ubuntu 20.10 (v0.8.4) doesn’t work with Linux v5.9 kernels (building the kernel module fails).
This leads to quite the predicament: How can I use both the required newer kernel version and ZFS (of course, including full functionality, such as ZSys)?
I’ve tried building and installing ZFS from source. However, the
.deb
packages created when building ZFS from source are incompatible with Ubuntu’s packages, and thus anything that depends on the Ubuntu packages (like ZSys!) falls victim to the package conflicts and has to be removed/cannot be installed.Due to these problems, I noticed that current Debian bullseye (testing) has newer packages with version 0.8.5 of ZFS (which is compatible with Linux v5.9), and the packaging scheme looks compatible with the one in Ubuntu. So I tried upgrading to these packages, and building the kernel modules for my mainline 5.9.8 kernel did indeed succeed. However, on boot, this fails to mount the ZFS file system (even with the normal 5.8 Ubuntu kernel):
Command: mount -o zfsutil -t zfs rpool/ROOT/ubuntu_682y7z /root// Message: filesystem 'rpool/ROOT/ubuntu_682y7z' can not be mounted: Permission denied
So, now I’m stuck. What is the most robust way of running a mainline kernel which also requires upgrading ZFS? I did consider building a custom 5.9 kernel with built-in ZFS support, but wouldn’t the ZFS version in my kernel then conflict with the installed Ubuntu packages, which use an older version of ZFS?
I noticed that, while the version of the ZFS packages in the Ubuntu development version (hirsute) is currently
0.8.4-1ubuntu13
, the changelog shows the following:which indicates that the required changes for compatibility with newer Linux kernels have been backported to these packages. So I installed the
zfs-dkms
package from thehirsute
repositories, which gave me a working DKMS ZFS module with my mainline kernel.