7

I installed ZFS on Debian, but can not get it working.


I try to install zfs this way:

  1. I added this to /etc/apt/sources.list :
deb http://deb.debian.org/debian/ buster main contrib non-free
deb http://deb.debian.org/debian buster-backports main contrib
  1. apt update and apt upgrade
  2. I installed these packages: buster-backports, zfsutils-linux, zfs-dkms, dpkg-dev, linux-headers-$(uname -r), linux-image-amd64
  3. And at this point problems accured.

I get these error when calling modprobe:

root@server /dev# modprobe zfs
modprobe: FATAL: **Module zfs not found in directory /lib/modules/4.19.0-14-amd64**

This is in my journalctl:

Feb 19 13:33:46 bytserver systemd[1]: Starting Install ZFS kernel module...
Feb 19 13:33:46 bytserver modprobe[490]: modprobe: FATAL: Module zfs not found in directory /lib/modules/4.19.0-14-amd64
Feb 19 13:33:46 bytserver systemd[1]: zfs-load-module.service: Main process exited, code=exited, status=1/FAILURE
Feb 19 13:33:46 bytserver systemd[1]: zfs-load-module.service: Failed with result 'exit-code'.
Feb 19 13:33:46 bytserver systemd[1]: Failed to start Install ZFS kernel module.
Feb 19 13:33:46 bytserver systemd[1]: Dependency failed for Import ZFS pools by cache file.
Feb 19 13:33:46 bytserver systemd[1]: zfs-import-cache.service: Job zfs-import-cache.service/start failed with result 'dependency'.
Feb 19 13:33:46 bytserver systemd[1]: Reached target ZFS pool import target.
Feb 19 13:33:46 bytserver systemd[1]: Condition check resulted in Mount ZFS filesystems being skipped.
Feb 19 13:33:46 bytserver systemd[1]: Starting Wait for ZFS Volume (zvol) links in /dev...
Feb 19 13:33:46 bytserver zvol_wait[496]: The ZFS modules are not loaded.
Feb 19 13:33:46 bytserver zvol_wait[496]: Try running '/sbin/modprobe zfs' as root to load them.
Feb 19 13:33:46 bytserver systemd[1]: Started Wait for ZFS Volume (zvol) links in /dev.
Feb 19 13:33:46 bytserver systemd[1]: Reached target ZFS volumes are ready.
Feb 19 13:33:46 bytserver systemd[1]: Starting ZFS file system shares...
Feb 19 13:33:46 bytserver zfs[567]: The ZFS modules are not loaded.
Feb 19 13:33:46 bytserver zfs[567]: Try running '/sbin/modprobe zfs' as root to load them.
Feb 19 13:33:46 bytserver systemd[1]: zfs-share.service: Main process exited, code=exited, status=1/FAILURE
Feb 19 13:33:46 bytserver systemd[1]: zfs-share.service: Failed with result 'exit-code'.
Feb 19 13:33:46 bytserver systemd[1]: Failed to start ZFS file system shares.
Feb 19 13:33:46 bytserver systemd[1]: Reached target ZFS startup target.
Feb 19 13:33:47 bytserver containerd[596]: time="2021-02-19T13:33:47.608958319+01:00" level=info msg="loading plugin \"io.containerd.snapshotter.v1.zfs\"..." type=io.containerd.snapshotter.v1
Feb 19 13:33:47 bytserver containerd[596]: time="2021-02-19T13:33:47.609214490+01:00" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.zfs\"..." error="path /var/lib/containerd/io.containerd.snapshotter.v1.zfs must be a zfs filesystem to be used with the zfs snapshotter: skip plugin" type=io.containerd.snapshotter.v1
Feb 19 14:27:39 bytserver sudo[1725]:     john : TTY=pts/1 ; PWD=/dev/disk/by-label ; USER=root ; COMMAND=/usr/bin/apt install zfs
Feb 19 14:27:53 bytserver sudo[2199]:     john : TTY=pts/1 ; PWD=/dev/disk/by-label ; USER=root ; COMMAND=/usr/bin/apt install zfs
Feb 19 14:30:58 bytserver sudo[2721]:     john : TTY=pts/1 ; PWD=/dev/disk/by-label ; USER=root ; COMMAND=/usr/bin/apt-get install zfs-dkms
Feb 19 14:31:21 bytserver sudo[2730]:     john : TTY=pts/1 ; PWD=/dev/disk/by-label ; USER=root ; COMMAND=/usr/sbin/modprobe zfs
Feb 19 14:31:29 bytserver sudo[2757]:     john : TTY=pts/1 ; PWD=/dev/disk/by-label ; USER=root ; COMMAND=/usr/bin/apt install zfs
Feb 19 14:34:21 bytserver sudo[2844]:     john : TTY=pts/1 ; PWD=/dev/disk/by-label ; USER=root ; COMMAND=/usr/bin/add-apt-repository ppa:zfs-native/stable
Feb 19 14:52:35 bytserver sudo[4094]:     john : TTY=pts/1 ; PWD=/home/john/openzfs-docs ; USER=root ; COMMAND=/usr/bin/vi /etc/apt/sources.list
Feb 19 14:53:47 bytserver sudo[4117]:     john : TTY=pts/1 ; PWD=/home/john/openzfs-docs ; USER=root ; COMMAND=/usr/bin/apt update
Feb 19 14:53:59 bytserver sudo[4562]:     john : TTY=pts/1 ; PWD=/home/john/openzfs-docs ; USER=root ; COMMAND=/usr/bin/vi /etc/apt/sources.list
Feb 19 14:54:08 bytserver sudo[4569]:     john : TTY=pts/1 ; PWD=/home/john/openzfs-docs ; USER=root ; COMMAND=/usr/bin/apt update
Feb 19 14:54:54 bytserver sudo[5016]:     john : TTY=pts/1 ; PWD=/home/john/openzfs-docs ; USER=root ; COMMAND=/usr/bin/su
Feb 19 14:56:22 bytserver sudo[6783]:     root : TTY=pts/1 ; PWD=/home/john/openzfs-docs ; USER=root ; COMMAND=/usr/bin/apt upgrade
Feb 19 14:56:59 bytserver sudo[6821]:    john : TTY=pts/1 ; PWD=/home/john/openzfs-docs ; USER=root ; COMMAND=/usr/bin/apt install --yes -t buster-backports --no-install-recommends zfs-dkms
Feb 19 14:57:20 bytserver sudo[6902]:     john : TTY=pts/1 ; PWD=/home/john/openzfs-docs ; USER=root ; COMMAND=/usr/bin/apt install --yes -t buster-backports zfsutils-linux
Feb 19 14:57:39 bytserver sudo[6925]:     john : TTY=pts/1 ; PWD=/home/john/openzfs-docs ; USER=root ; COMMAND=/usr/bin/apt install --yes mdadm
Feb 19 15:03:10 bytserver sudo[7047]:     john : TTY=pts/1 ; PWD=/home/john ; USER=root ; COMMAND=/usr/bin/apt install -t buster-backports zfsutils-linux
Feb 19 15:03:23 bytserver sudo[7051]:     john : TTY=pts/1 ; PWD=/home/john ; USER=root ; COMMAND=/usr/bin/apt install -t buster-backports zfsutils-linu
Feb 19 15:03:33 bytserver sudo[7055]:     john : TTY=pts/1 ; PWD=/home/john ; USER=root ; COMMAND=/usr/bin/apt install zfs-dkms
Feb 19 15:05:36 bytserver systemd-udevd[7143]: Process '/sbin/modprobe zfs' failed with exit code 1.
Feb 19 15:07:20 bytserver systemd-udevd[7149]: Process '/sbin/modprobe zfs' failed with exit code 1.
Feb 19 15:10:51 bytserver sudo[7299]:     john : TTY=pts/1 ; PWD=/home/john ; USER=root ; COMMAND=/usr/bin/apt-get -y install zfs-dkms
Feb 19 15:11:58 bytserver sudo[7322]:     john : TTY=pts/1 ; PWD=/home/john ; USER=root ; COMMAND=/usr/bin/systemctl restart zfs-import-cache
Feb 19 15:11:58 bytserver systemd[1]: Starting Install ZFS kernel module...
Feb 19 15:11:58 bytserver modprobe[7325]: modprobe: FATAL: Module zfs not found in directory /lib/modules/4.19.0-14-amd64
Feb 19 15:11:58 bytserver systemd[1]: zfs-load-module.service: Main process exited, code=exited, status=1/FAILURE
Feb 19 15:11:58 bytserver systemd[1]: zfs-load-module.service: Failed with result 'exit-code'.
Feb 19 15:11:58 bytserver systemd[1]: Failed to start Install ZFS kernel module.
Feb 19 15:11:58 bytserver systemd[1]: Dependency failed for Import ZFS pools by cache file.
Feb 19 15:11:58 bytserver systemd[1]: zfs-import-cache.service: Job zfs-import-cache.service/start failed with result 'dependency'.
Feb 19 15:15:56 bytserver sudo[7387]:     john : TTY=pts/1 ; PWD=/home/john ; USER=root ; COMMAND=/usr/bin/apt-get install zfsutils-linux

What could I do diagnoze and to fix it?
Thank you for help

6
  • 1
    Have you rebooted since installing the new kernel module? Commented Feb 19, 2021 at 18:27
  • @kemotep maybe 5 times Commented Feb 19, 2021 at 18:28
  • Okay, can you edit your post to include the steps you took to install ZFS? Commented Feb 19, 2021 at 18:32
  • @JanČerný did you install the kernel-headers first? or it won't work because it can't compile the dkms module Commented Feb 19, 2021 at 18:54
  • 3
    @JanČerný looks like you need to install the kernel header before. Try and uninstall everything and do it each step individually. Commented Feb 19, 2021 at 19:01

3 Answers 3

4

Your Debian system failed to build zfs kernel module because your Linux kernel was not compatible with zfs version shipped in package source.

You can go to https://zfsonlinux.org/, get a compatible version with your Linux kernel version, and build zfs kernel to suite your needs.

For example, at this time, zfs version 2.0.7 does support Linux with 3.10 - 5.15 kernels.

zfs kernel module installation

Get zfs release

wget https://github.com/openzfs/zfs/releases/download/zfs-2.0.7/zfs-2.0.7.tar.gz

Build & install

tar -xvzf zfs-2.0.7.tar.gz
cd zfs-2.0.7
./configure
make
sudo make install

Add module from the kernel

sudo modprobe -v zfs
3

I had a similar issue in Ubuntu 22.04 after upgrading the kernel. The following worked for me

sudo apt purge --auto-remove zfsutils-linux 
sudo apt install zfs-dkms
sudo apt install zfsutils-linux
1

You need the linux headers for your current kernel version.

are linux-headers-$(uname -r) and zfs-dkms installed? you'd need those... Source: AllKind on Github

If your linux headers are not available anymore, you can reference this Q&A on how to pull them from a snapshot.

What I did right now is this:

# sudo vim /etc/apt/sources.list.d/snapshot.list
deb https://snapshot.debian.org/archive/debian/20240701T023644Z trixie main
# :wq

sudo apt -o Acquire::Check-Valid-Until=false update
sudo apt policy linux-headers-*
sudo apt install linux-headers-$(uname -r)
sudo apt install --reinstall zfsutils-linux

You should of course adjust based on your distribution. Do not use trixie if you are not on trixie. The timestamp here refers to the first of july 2024, found here in the url once you click a date.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.