2

After I rebooted a CentOS server, ZFS does not work:

$ sudo zfs list
The ZFS modules are not loaded.
Try running '/sbin/modprobe zfs' as root to load them.

$ sudo modprobe zfs
modprobe: FATAL: Module zfs not found.

My OS version is CentOS Linux release 7.2.1511 (Core) and uname -r prints 3.10.0-327.18.2.el7.x86_64.

I noticed that some packages seemed to be updated automatically when the machine booted up - I found the following entries in /var/log/yum.log:

Feb 28 10:11:17 Updated: epel-release-7-9.noarch
Feb 28 10:11:29 Updated: openblas-openmp64-0.2.19-4.el7.x86_64
Feb 28 10:11:30 Updated: openblas-threads64_-0.2.19-4.el7.x86_64
Feb 28 10:11:31 Updated: openblas-openmp-0.2.19-4.el7.x86_64
Feb 28 10:11:32 Updated: openblas-serial64_-0.2.19-4.el7.x86_64
Feb 28 10:11:33 Updated: openblas-threads-0.2.19-4.el7.x86_64
Feb 28 10:11:34 Updated: openblas-threads64-0.2.19-4.el7.x86_64
Feb 28 10:11:35 Updated: openblas-0.2.19-4.el7.x86_64
Feb 28 10:11:36 Updated: openblas-openmp64_-0.2.19-4.el7.x86_64
Feb 28 10:11:37 Updated: openblas-serial64-0.2.19-4.el7.x86_64
Feb 28 10:11:37 Updated: openblas-devel-0.2.19-4.el7.x86_64
Feb 28 10:11:43 Updated: libtirpc-0.2.4-0.8.el7.x86_64
Feb 28 10:11:44 Updated: 1:nfs-utils-1.3.0-0.33.el7.x86_64
Feb 28 10:12:22 Installed: kernel-devel-3.10.0-514.6.2.el7.x86_64
Feb 28 10:12:27 Updated: x2goserver-4.0.1.20-1.el7.x86_64
Feb 28 10:12:27 Updated: x2goserver-xsession-4.0.1.20-1.el7.x86_64

From dkms status, it seems that ZFS is not installed:

$ sudo dkms status
nvidia, 352.93, 3.10.0-327.10.1.el7.x86_64, x86_64: installed
nvidia-uvm, 352.93, 3.10.0-327.10.1.el7.x86_64, x86_64: installed (original_module exists)
spl, 0.6.5.9: added
zfs, 0.6.5.9: added
nvidia-uvm, 352.93, 3.10.0-229.el7.x86_64, x86_64: installed-weak from 3.10.0-327.10.1.el7.x86_64
nvidia, 352.93, 3.10.0-327.18.2.el7.x86_64, x86_64: installed-weak from 3.10.0-327.10.1.el7.x86_64
nvidia-uvm, 352.93, 3.10.0-327.18.2.el7.x86_64, x86_64: installed-weak from 3.10.0-327.10.1.el7.x86_64
nvidia, 352.93, 3.10.0-327.4.4.el7.x86_64, x86_64: installed-weak from 3.10.0-327.10.1.el7.x86_64
nvidia-uvm, 352.93, 3.10.0-327.4.4.el7.x86_64, x86_64: installed-weak from 3.10.0-327.10.1.el7.x86_64

and when I try to do dkms install I get an error:

$ sudo dkms install zfs/0.6.5.9 
Error! echo
Your kernel headers for kernel 3.10.0-327.18.2.el7.x86_64 cannot be found at
/lib/modules/3.10.0-327.18.2.el7.x86_64/build or /lib/modules/3.10.0-327.18.2.el7.x86_64/source.

The version of kernel-headers seems to match kernel, but there is no kernel-devel package of the same version in the repository.

$ yum list installed | grep kernel
kernel.x86_64                         3.10.0-229.el7                   @anaconda
kernel.x86_64                         3.10.0-327.4.4.el7               @updates 
kernel.x86_64                         3.10.0-327.10.1.el7              @updates 
kernel.x86_64                         3.10.0-327.18.2.el7              @updates 
kernel-devel.x86_64                   3.10.0-327.28.3.el7              @updates 
kernel-devel.x86_64                   3.10.0-327.36.1.el7              @updates 
kernel-devel.x86_64                   3.10.0-327.36.2.el7              @updates 
kernel-devel.x86_64                   3.10.0-327.36.3.el7              @updates 
kernel-devel.x86_64                   3.10.0-514.6.2.el7               @updates 
kernel-headers.x86_64                 3.10.0-327.18.2.el7              @updates 
kernel-tools.x86_64                   3.10.0-327.18.2.el7              @updates 
kernel-tools-libs.x86_64              3.10.0-327.18.2.el7              @updates 

$ sudo yum install "kernel-devel-uname-r == $(uname -r)"
[...]
No package kernel-devel-uname-r == 3.10.0-327.18.2.el7.x86_64 available.
Error: Nothing to do

How should I proceed?

I thought of upgrading the kernel (to release 514.6.2.el7), but I'm adverse to doing this because I'm worried that it might break things. (I inherited this server as a temporary admin and I don't understand everything about how it is configured.)

pterojacktyl
  • 121
  • 1
  • 3
  • See https://github.com/zfsonlinux/zfs/wiki/RHEL-%26-CentOS – NickD Feb 28 '17 at 16:58
  • 1
    It seems that your main problem here is this auto-update done on reboot, which updated your `kernel-devel` to 3.10.0-514.6.2. I would suggest you trying to remove it, then re-installing it by hand (yum ?). – Ouki Feb 28 '17 at 17:04
  • 2
    Try to download the corresponding `kernel-devel` from [vault.centos.org](http://vault.centos.org/7.2.1511/updates/x86_64/Packages/) and install it manually with `yum install .rpm` or integrate this repository into `/etc/yum.repos.d`. – Thomas Feb 28 '17 at 17:50
  • Thanks @Thomas! I added the vault to `/etc/yum.repos.d` and I was able to install the matching version of `kernel-devel` – pterojacktyl Feb 28 '17 at 18:26

2 Answers2

0

Run:

depmod -a; modprobe zfs

And again:

dkms build -m zfs -v $(zfsVersion)
Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
0

You must upgrade the ZFS YUM repository each time the kernel version changes, so that the 2 versions coincide. And then update both ZFS and the kernel.