DEV Community

Arthur
Arthur

Posted on

Setting Up OpenZFS on Rocky Linux

The RHEL distribution of OpenZFS has two main implementations of ZFS, outlined below:

  1. DKIMS (Dynamic Kernel Module Support)
    This implementation is built on the premise that; the system should automatically recompile all DKMS modules if a new kernel version is installed. This allows drivers and devices outside the mainline kernel to continue working after a Linux kernel upgrade.

  2. kABI-tracking kmod packages
    The Kernel Application Binary Interface (kABI) is a set of in-kernel symbols used by drivers and other kernel modules. Each major and minor RHEL kernel release has a bunch of in-kernel symbols that are whitelisted. A kABI-tracking kmod package contains a kernel module that is compatible with a given kABI, that is, for a given major and minor release of the EL kernel.

The RHEL OpenZFS packages are provided by the following repository:

For EL7:

yum install https://zfsonlinux.org/epel/zfs-release-2-3$(rpm --eval "%{dist}").noarch.rpm
Enter fullscreen mode Exit fullscreen mode

and for EL8 and 9:

dnf install https://zfsonlinux.org/epel/zfs-release-2-3$(rpm --eval "%{dist}").noarch.rpm
Enter fullscreen mode Exit fullscreen mode

After adding that repository, update your repository cache with either;

EL7

yum update -y
Enter fullscreen mode Exit fullscreen mode

EL8 And above

dnf update -y
Enter fullscreen mode Exit fullscreen mode

After that, you have the option to install either the DKMS or kABI-tracking kmod style packages.
I have not had any luck using the DKMS style package (which is the default) and as such, my personal preference is the kABI-tracking.

The commands that follow will only show how to install OpenZFS using EL 8 and above if you need to do this for EL 7 and below; replace dnf with yum and dnf config-manager with yum-config-manager

DKMS

Installing the DKMS style, requires the following three (3) commands:

dnf install -y epel-release
dnf install -y kernel-devel
dnf install -y zfs
Enter fullscreen mode Exit fullscreen mode

kABI Style

Installing the kABI-Tracking kmod, disable the default DKMS style and then install zfs with the following commands.

dnf config-manager --disable zfs
dnf config-manager --enable zfs-kmod
dnf install zfs
Enter fullscreen mode Exit fullscreen mode

By default, the OpenZFS kernel modules are automatically loaded when a ZFS pool is detected. If you would prefer to always load the modules at boot time you can create such configuration in /etc/modules-load.d:

Below is a helper command:

echo zfs >/etc/modules-load.d/zfs.conf
Enter fullscreen mode Exit fullscreen mode

After that, you can confirm if zfs is properly set by using modprobe, as shown below:

/sbin/modprobe zfs
Enter fullscreen mode Exit fullscreen mode

If you get an empty response, then all is well. Otherwise, get a cup of coffee and have fun debugging the issue.

Top comments (0)