Ubuntu – Is zfs-dkms required for ZFS support in generic kernels

dkmsinitramfskernelzfs

I adapted a ZoL guide for putting Ubuntu Server 14.04 on ZFS root for 18.04 Bionic Beaver and desktop installations: http://vlog.averyfreeman.com/doku.php/ubuntu.18.04.desktop.on.zfs

I'm trying to make sure I have all of the information correct, I've run into a couple issues I'm not sure how to answer:

Does ZFS support in Ubuntu for generic kernels require the zfs-dkms package, or is just zfs-initramfs enough? (Do generic kernels in Ubuntu have kABI extensions?)

If anyone actually follows it, I'd like them to have a bootable system after a kernel upgrade! 🙂

Also, is there a way to prevent having to invoke # zfs import -f
rpool
and reboot after boot of updated kernel?

Best Answer

From Ubuntu Wiki ZFS:

ZFS

Summary

ZFS is a combined file system and logical volume manager designed and implemented by a team at Sun Microsystems led by Jeff Bonwick and Matthew Ahrens. Its development started in 2001 and it was officially announced in 2004. In 2005 it was integrated into the main trunk of Solaris and released as part of OpenSolaris. Currently, as of January 2015, it is native to Solaris, OpenSolaris, OpenIndiana, illumos, Joyent SmartOS, OmniOS, FreeBSD, Debian GNU/kFreeBSD systems, NetBSD, OSv and supported on Mac OS with MacZFS.

The name "ZFS" originally stood for "Zettabyte File System". Currently it can store up to 256 ZiB (zebibytes).

Installing ZFS on Ubuntu

The ZFS filesystem is available for Ubuntu as either a FUSE module or a native kernel module. The kernel module is provided by default. To install the user-level tools, simply install:

sudo apt install zfsutils-linux 

For all current versions from 16.04 onward.

In addition to be able to have ZFS on root, install:

sudo apt install zfs-initramfs 

No where is it mentioned that zfs-dkms is a prerequisite.


kABI

kABI is the Kernel Application Binary Interface. It doesn't change very often but when it does all programs must share the same version.

Tracking ABI/API changes

From the ABI Labratory we can see the last changes were on June 4, 5 and 6th, 2018:

Linux ABI changes.png

We can see the Linux Kernel numbers revised in June 2018 were:

  • 4.14.48, 4.9.107 and 4.4.136 all 6 year LTS kernels

The corresponding Ubuntu Kernel version numbers were probably:

We need to upgrade Linux Kernels when new hardware support or bug fixes to existing hardware are released. When an ABI/API change is involved the Ubuntu kernel may or may not work. Even if an ABI/API change doesn't take place the Ubuntu Kernel may still break for some people for other reasons.

If you have a generic Ubuntu Kernel and a Linux Mainline kernel after June 2018 in this example, they would both share the same kABI.

Related Question