zfs
zfs copied to clipboard
RHEL 9.1 - openZFS (Error after fresh-install)
Discussed in https://github.com/openzfs/zfs/discussions/14446
Originally posted by ArchMatt-GraveKeeper January 31, 2023 Yo everybody :) i hope there is somebody who will solved my problem after fresh install of openzfs https://openzfs.github.io/openzfs-docs/Getting%20Started/RHEL-based%20distro/index.html#
as root user i applied these commands:
dnf install https://zfsonlinux.org/epel/zfs-release-2-2$(rpm --eval "%{dist}").noarch.rpm
subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
dnf install https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-9.noarch.rpm
dnf install -y epel-release
dnf install -y kernel-devel
dnf install -y zfs
after these commands i want to create raidz pool of my sda,sdb,sdc,sdd disks
zpool create afterlife raidz1 sda sdb sdc sdd -f
but i got error which is:
The ZFS modules are not loaded. Try running '/sbin/modprobe zfs' as root to load them.
so i type it the problem to the terminal then:
/sbin/modprobe zfs
modprobe: FATAL: Module zfs not found in directory /lib/modules/5.14.0-162.12.1.el9_1.x86_64
yea i made it research but didn't find nothing to be helpful :)
Thanks for advice's :)
The issue is probably that you haven't installed the latest kernel and rebooted, so when you do
dnf install -y kernel-devel
...from the instructions you're getting a kernel-devel package that doesn't match your current running kernel. You can probably do this:
dnf install -y kernel-devel-$(uname -r)
...and that may fix it. You may need to run 'dnf reinstall zfs' afterwards or the command to manually rebuild the dkms module - I don't have that handy. Good luck!
The issue is probably that you haven't installed the latest kernel and rebooted, so when you do
dnf install -y kernel-devel
...from the instructions you're getting a kernel-devel package that doesn't match your current running kernel. You can probably do this:
dnf install -y kernel-devel-$(uname -r)
...and that may fix it. You may need to run 'dnf reinstall zfs' afterwards or the command to manually rebuild the dkms module - I don't have that handy. Good luck!
dnf install -y kernel-devel
Updating Subscription Management repositories.
Last metadata expiration check: 0:54:47 ago on Wed Feb 1 15:09:53 2023.
Package kernel-devel-5.14.0-162.6.1.el9_1.x86_64 is already installed.
Package kernel-devel-5.14.0-162.12.1.el9_1.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
dnf install -y kernel-devel-$(uname -r)
Updating Subscription Management repositories.
Last metadata expiration check: 0:55:15 ago on Wed Feb 1 15:09:53 2023.
Package kernel-devel-5.14.0-162.12.1.el9_1.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
As you can see they was build also still remaining the problem :)
I even tried dnf reinstall zfs
but didn't helped
Could it be a problem with a SELinux policy ? on RHEL ? Should i add some items into policy ? ?
Don't think it's SELinux - I've used SELinux without modification or issue
Can you confirm what version of zfs-dkms is installed with this:
rpm -qa | grep zfs-dkms
Can you try this and see if you get a useful error:
dkms install -m zfs -v 2.1.9
(the above is assuming you have zfs-dkms-2.1.9-1.el9.noarch installed)
dkms install -m zfs -v 2.1.9
rpm -qa | grep zfs-dkms
zfs-dkms-2.1.9-1.el9.noarch
dkms install -m zfs -v 2.1.9
Sign command: /lib/modules/5.14.0-162.12.1.el9_1.x86_64/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Warning: The pre_build script is not executable.
Building module: Cleaning build area...(bad exit status: 2) make -j8 KERNELRELEASE=5.14.0-162.12.1.el9_1.x86_64...(bad exit status: 2) Error! Bad return status for module build on kernel: 5.14.0-162.12.1.el9_1.x86_64 (x86_64) Consult /var/lib/dkms/zfs/2.1.9/build/make.log for more information.
This is what i get :)
It might be interesting to look in /var/lib/dkms/zfs/2.1.9/build/make.log to get a more specific error.
DKMS make.log for zfs-2.1.9 for kernel 5.14.0-162.12.1.el9_1.x86_64 (x86_64) Wed Feb 1 23:30:31 CET 2023 make: *** No targets specified and no makefile found. Stop.
Today I followed the install instructions at openzfs.org and most of the trouble shooting in this thread with identical results up to the output in make.log.
I don't know much about DKMS modules, but I'm happy to run more diagnostics if there are more things to try.
System Info:
OS: rpm -q almalinux-release
almalinux-release-9.1-1.9.el9.x86_64
Kernel: uname -r
5.14.0-162.12.1.el9_1.x86_64
Package Info:
rpm -qa epel-release
epel-release-9-4.el9.noarch
rpm -qa kernel-devel
kernel-devel-5.14.0-162-12.1.el9_1.x86_64
rpm -qa zfs
zfs-9.1.9-1.el9.x86_64
DKMS Info:
rpm -qa zfs-dkms
zfs-dkms-2.1.9-1.el9.noarch
dkms status | grep zfs
zfs/2.1.9: added
Troubleshooting:
$ sudo /sbin/modprobe zfs
modprobe: FATAL: Module zfs not found in directory /lib/modules/5.14.0-162.12.1.el9_1.x86_64
$ sudo dkms install zfs/2.1.9
Sign command: /lib/modules/5.14.0-162.12.1.el9_1.x86_64/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Warning: The pre_build script is not executable.
Building module: Cleaning build area...(bad exit status: 2) make -j8 KERNELRELEASE=5.14.0-162.12.1.el9_1.x86_64...(bad exit status: 2) Error! Bad return status for module build on kernel: 5.14.0-162.12.1.el9_1.x86_64 (x86_64) Consult /var/lib/dkms/zfs/2.1.9/build/make.log for more information.
$ cat /var/lib/dkms/zfs/2.1.9/build/make.log
DKMS make.log for zfs-2.1.9 for kernel 5.14.0-162.12.1.el9_1.x86_64 (x86_64)
Sat Feb 18 02:56:54 PM EST 2023
make: *** No targets specified and no makefile found. Stop.
I should have checked #14446 before. @ArchMatt-GraveKeeper hopefully this helps resolve your issue as well.
Originally, I had my boot disk formatted according to CIS Benchmark for RHEL 9 which recommends the following be mounted with noexec
:
/tmp
(level 1 server)
/dev/shm
(level 1 server)
/var
(level 2 server)
/var/tmp
(level 2 server)
/var/log
(level 2 server)
/var/log/audit
(level 2 server)
I removed noexec
from all of these, rebooted, reinstalled zfs, and then /sbin/modprobe zfs
worked.
I think moving forward I may just keep the level 1 recommendations, and if that causes issues may move dkms compilation to another directory.
I should have checked #14446 before. @ArchMatt-GraveKeeper hopefully this helps resolve your issue as well.
Originally, I had my boot disk formatted according to CIS Benchmark for RHEL 9 which recommends the following be mounted with
noexec
:/tmp
(level 1 server)/dev/shm
(level 1 server)/var
(level 2 server)/var/tmp
(level 2 server)/var/log
(level 2 server)/var/log/audit
(level 2 server)I removed
noexec
from all of these, rebooted, reinstalled zfs, and then/sbin/modprobe zfs
worked.I think moving forward I may just keep the level 1 recommendations, and if that causes issues may move dkms compilation to another directory.
Yes this help, you really must remove noexec from everything. How stupid it is .. :+1: RHEL is cool but not cool with ZFS much :smile: :smile_cat: , really trouble shoot if you are running CIS Benchmarks....