Thursday, December 7, 2017

package: zfs-dkms requires dkms >= 2.2.0.3

Solution

First install EPEL release repo

sudo yum install epel-release

This should fix the initial install issue. However once the install is complete zfs may not work properly, you may see:

# zpool status
The ZFS modules are not loaded
Try running '/sbin/modprobe zfs' as root to load them

However, running modprobe results in the following
 
# modprobe zfs
modprobe: FATAL: Module zfs not found

Looking at DKMS you will see the modules are added, but never installed and attempting to install them fails. This seems to be a bug if you don't install epel-release before installing kernel-devel.
 
# dkms status
spl, 0.7.3: added
zfs, 0.7.3: added

# dkms install -m spl -v 0.7.3
Error ! echo
Your kernel headers for kernel 3.10.0.693.el7.x86_64 cannot be found at
/lib/modules/3.10.0-693.el7.x86_64/build or /lib/modules/3.10.0.693.el7.x86_64/source

A reboot seems to solve the spl module issue, but the zfs module still refuses to install 

#reboot
[truncated reboot output]
 ...
[login]
 ...
#dkms status
spl, 0.7.3 3.10.0-693.11.1.el7.x86_64, x86_64: installed
zfs, 0.7.3: added

# dkms install -m zfs -v 0.7.3
[truncating error message, but there's a lot of exit code status 2, failed to clean build area, unable to remove file messages]

However, then run the zfs install again and it works... for some reason? 

# dkms install -m zfs -v 0.7.3
 [truncating a really long install process output]
DKMS: install completed

# modprobe zfs
# zpool status
no pools available

This doesn't make much sense, but best guess is that the install fails initially (due to the epel-release not being installed) in a not-very-elegant way. This leaves behind junk that causes the install to fail in the future. Rebooting and manually running the install clears that junk. This is all conjecture, but I hope it helps someone!
 

Additional troubleshooting

I've run through this a few times now, and the error doesn't seem to resolve the same way everytime. Most recent time I did it, the restart/manual install didn't work for the zfs module (spl installed after a reboot as before). I had to remove the ZFS module and re-add it.


# dkms remove -m zfs -v 0.7.3 --all
[output from removal]

# dkms add -m zfs -v 0.7.3
[output from add]

# dkms install -m zfs -v 0.7.3
[and it should work now]

1 comment:

  1. I"m interested to see how this goes :)

    I'm thinking of building some sort of clustered HA storage for off-site backups and I see you have been at it for years. I have hardware lying around too ;)

    ReplyDelete