Restoring ZFS after kernel update

Yesterday I ran a system update and didn’t realize that it was going to put my kernel and the ZFS module out of sync. Now I have kernel 4.18.0-372.16.1.el8_6.0.1.x86_64, and ZFS version 2.0.6-1.

I’ve tried running sudo dkms --force install zfs/2.0.6; but the ZFS version doesn’t successfully build for the new kernel, so I can’t load the modules:

[root@backup zfs]# modprobe zfs
modprobe: FATAL: Module zfs not found in directory /lib/modules/4.18.0-372.16.1.el8_6.0.1.x86_64

What steps do I need to take in order to get ZFS back up again (I’m not that familiar with how to do things on Rocky/RHEL? Do I need to downgrade the kernel, or is there a newer version of ZFS that can be used somehow?

During reboot you will have the option to boot other kernels from the grub menu. By default there should be at least 3 - 5 to choose from. That will at least get you using zfs again until you can build it in the newer kernel.

Hmm, that unfortunately doesn’t really help me as the host is a remote headless machine, so I can’t do anything with the grub menu on boot.

Would it be possible to somehow install ZFS 2.1.5 from the ZOL site and build a new kernel with that? It seems that the kernels supported by 2.1.5 are 3.10 - 5.18, so my Rocky Linux with 4.18 should be good. When I tried doing this I end up installing a bunch of dependencies for the ZFS build, but I get stuck with a package missing that I can’t seem to install with dnf - libssl-devel

Ah well I wouldn’t have known that as you didn’t mention in the original post if it was remote or not. With access to the server, or via IPMI access remotely, it would be possible to choose the boot entry from the kernel.

You can of course set GRUB_DEFAULT to one of the other entries and update the grub config, but maybe not risk if if you are fully remote in case one of the options stops you gaining network access.


dnf install openssl-devel

otherwise, the build instructions are using the wrong dependency name. But that’s the responsibility of ZOL if they got it wrong.

Ah yes, sorry, I completely forgot to mention that I was looking at a remote server, my head was completely down in the details of the problem already.

I managed to build ZFS using the openssl-devel package, so indeed the ZFS build scripts are responding with the wrong package name. With v2.1.5 of ZFS the kernel module can be loaded and the ZFS pool brought back into use.

I’ll be reinstalling the official ZFS package once the new release gets propagated to the package repo.

Thanks for the help.

1 Like