how to manage kernel versions and dkms zfs/spl modules

asked 2018-09-12 09:10:45 -0500

fermulator gravatar image

updated 2018-09-17 12:33:00 -0500

Good day experts!

I have had issues in this area for years, and finally getting around to asking. Two scenarios:

  • A) Desktop Fedora 27 (w/ ZFS storage, non-root boot)
  • B) Server Fedora 27 (w/ ZFS storage + root boot)

For the desktop, every time the kernel updates I have to re-install zfs and spl modules post-reboot. While annoying, not disastrous since its just a secondary storage platter. Not the focus of this post.

For the server, I have two issues:

  1. Since upgrade from f22 to f27, the actual kernel booting was stuck on f22
  2. After forcing grub mkconfig to take in the latest kernel, zfs/spl modules were not automatically built into initramfs


  • Fedorda22 server was initially installed and built for ZFS root boot (roughlysteps were like this, but back then years ago, the instructions were different)
  • Did not upgrade the OS for many years due to FUD as to whether or not I'd break the ZFS boot.
  • Finally earlier this year I bit the bullet and just did it (prepared w/ backups etc in case something went wrong) - but to my surprise, it booted and everything was fine! (or so I thought)
  • I neglected to check if I was actually booting the intended f27 kernel ... as it turns out (we will see shortly), it was forever stuck booting an older 4.3 kernel from f22.


I first noticed all of this as per: (was hitting an old ZFS issue/bug, but I thought I was running latest kernels + zfs versions, but it turns out not!)


To repeat the important bits here, this is the state I found myself in:

$ sudo modprobe zfs
modprobe: FATAL: Module zfs not found in directory /lib/modules/4.3.4-200.fc22.x86_64

$ find /lib/modules | grep zfs

$ uname -a
Linux (HOSTNAME) 4.3.4-200.fc22.x86_64 #1 SMP Mon Jan 25 13:37:15 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/fedora-release 
Fedora release 27 (Twenty Seven)

$ rpm -qa | grep zfs

$ sudo scripts/filesystem/
[sudo] password for fermulator:
/boot/initramfs-0-rescue-72b97c7344964f3d9c98cacf0caca2f8.img: zfs.ko MISSING
/boot/initramfs-4.17.19-100.fc27.x86_64.img: MISSING
/boot/initramfs-4.17.2-100.fc27.x86_64.img: zfs.ko MISSING
/boot/initramfs-4.3.4-200.fc22.x86_64.img: OK

The BEFORE situation:

# grep ROOT grub.cfg_F22_backup 
    linuxefi /ROOT/fedora@/boot/vmlinuz-4.3.4-200.fc22.x86_64 root=ZFS=zmain/ROOT/fedora ro rhgb quiet efi_no_storage_paranoia boot=zfs rpool=zmain 
    initrdefi /ROOT/fedora@/boot/initramfs-4.3.4-200.fc22.x86_64.img
    linuxefi /ROOT/fedora@/boot/vmlinuz-4.0.4-301.fc22.x86_64 root=ZFS=zmain/ROOT/fedora ro rhgb ...
edit retag flag offensive close merge delete