0

I was trying to install ZFS on Debian 11 and a prerequisite is to install the proper kernel headers. Every package I have tried to install has not worked. My kernel is 5.10.0-18-amd64, but these all try and use 5.10.0-19-amd64. This is on a fresh Linode Debian install.

'linux-headers-amd64' and 'linux-headers-generic'

The OpenZFS tutorial recommends installing 'linux-headers-generic' and the Debian wiki recommends 'linux-headers-amd64', and neither seem to work as intended. When I try to install kernel headers from the packages in the title, they appear to be on the wrong version. The headers themself install fine, but when I install zfsutils-linux

Module build for kernel 5.10.0-18-amd64 was skipped since the
kernel headers for this kernel does not seem to be installed.

Still, zfsutils-linux install fine. But after installation, when I check to verify if ZFS is working I see

root@localhost:~# modprobe zfs
modprobe: FATAL: Module zfs not found in directory /lib/modules/5.10.0-18-amd64

grepping dpkg, the headers say 5.10.0-19

root@localhost:~# dpkg -l | grep "linux-header"
ii  linux-headers-5.10.0-19-amd64  5.10.149-2                     amd64        Header files for Linux 5.10.0-19-amd64
ii  linux-headers-5.10.0-19-common 5.10.149-2                     all          Common header files for Linux 5.10.0-19
ii  linux-headers-amd64            5.10.149-2                     amd64        Header files for Linux amd64 configuration (meta-package)

linux-headers-$(uname -r)

OK, let's explicitly try and install the correct version with "linux-headers-$(uname -r)". I didn't want to do it like this because (and correct me if I'm wrong), it makes it a pain to update compared to the other two metapackages. Anyway this is what it says

Preconfiguring packages ...
Selecting previously unselected package dctrl-tools.
(Reading database ... 61322 files and directories currently installed.)
Preparing to unpack .../00-dctrl-tools_2.24-3+b1_amd64.deb ...
Unpacking dctrl-tools (2.24-3+b1) ...
Selecting previously unselected package dkms.
Preparing to unpack .../01-dkms_2.8.4-3_all.deb ...
Unpacking dkms (2.8.4-3) ...
Selecting previously unselected package zfs-dkms.
Preparing to unpack .../02-zfs-dkms_2.1.5-1~bpo11+1_all.deb ...
Unpacking zfs-dkms (2.1.5-1~bpo11+1) ...
Selecting previously unselected package libnvpair3linux.
Preparing to unpack .../03-libnvpair3linux_2.1.5-1~bpo11+1_amd64.deb ...
Unpacking libnvpair3linux (2.1.5-1~bpo11+1) ...
Selecting previously unselected package libuutil3linux.
Preparing to unpack .../04-libuutil3linux_2.1.5-1~bpo11+1_amd64.deb ...
Unpacking libuutil3linux (2.1.5-1~bpo11+1) ...
Selecting previously unselected package libzfs4linux.
Preparing to unpack .../05-libzfs4linux_2.1.5-1~bpo11+1_amd64.deb ...
Unpacking libzfs4linux (2.1.5-1~bpo11+1) ...
Selecting previously unselected package libzpool5linux.
Preparing to unpack .../06-libzpool5linux_2.1.5-1~bpo11+1_amd64.deb ...
Unpacking libzpool5linux (2.1.5-1~bpo11+1) ...
Selecting previously unselected package zfsutils-linux.
Preparing to unpack .../07-zfsutils-linux_2.1.5-1~bpo11+1_amd64.deb ...
Unpacking zfsutils-linux (2.1.5-1~bpo11+1) ...
Selecting previously unselected package zfs-zed.
Preparing to unpack .../08-zfs-zed_2.1.5-1~bpo11+1_amd64.deb ...
Unpacking zfs-zed (2.1.5-1~bpo11+1) ...
Selecting previously unselected package linux-headers-5.10.0-19-common.
Preparing to unpack .../09-linux-headers-5.10.0-19-common_5.10.149-2_all.deb ...
Unpacking linux-headers-5.10.0-19-common (5.10.149-2) ...
Selecting previously unselected package linux-headers-5.10.0-19-amd64.
Preparing to unpack .../10-linux-headers-5.10.0-19-amd64_5.10.149-2_amd64.deb ...
Unpacking linux-headers-5.10.0-19-amd64 (5.10.149-2) ...
Selecting previously unselected package linux-headers-amd64.
Preparing to unpack .../11-linux-headers-amd64_5.10.149-2_amd64.deb ...
Unpacking linux-headers-amd64 (5.10.149-2) ...
Setting up libnvpair3linux (2.1.5-1~bpo11+1) ...
Setting up linux-headers-5.10.0-19-common (5.10.149-2) ...
Setting up libuutil3linux (2.1.5-1~bpo11+1) ...
Setting up dctrl-tools (2.24-3+b1) ...
Setting up linux-headers-5.10.0-19-amd64 (5.10.149-2) ...
Setting up linux-headers-amd64 (5.10.149-2) ...
Setting up libzfs4linux (2.1.5-1~bpo11+1) ...
Setting up dkms (2.8.4-3) ...
Setting up zfs-dkms (2.1.5-1~bpo11+1) ...
Loading new zfs-2.1.5 DKMS files...

It keeps mentioning patch 19 explicitly here which is weird, but after a while it says

Building for 5.10.0-18-amd64 5.10.0-19-amd64
Building initial module for 5.10.0-18-amd64
Done.

It seems like it build it for patch 18 so all is good right? But then...

depmod.....

DKMS: install completed.
Building initial module for 5.10.0-19-amd64

Yes, it still builds for a kernel patch ahead of what I have when I explicitly told it to install patch 18. And I have been stuck on "Building initial module for 5.10.0-19-amd64" for a few hours now, unsure what to do.

Is the package just not pulling my kernel data correctly and shipping with the wrong version? Or am I doing something wrong? The patch 19 kernel header should be useless to me since I'm on patch 18 right? Or maybe I could get away with moving the header files somewhere? I've checked and the version of ZFS I am installing should support my kernel version.

2
  • Is there any reason not to upgrade to the -19- kernel? (sudo apt install linux-image-amd64 will do that for you, then you need to reboot your instance.) Commented Nov 3, 2022 at 22:17
  • It just says I am already on the correct version already, and indeed I have both patch 18 and 19. This was pre-installed. Maybe this Linode image comes with both patches and it tries to install the latest one? At any rate, I CTRL-C'd out of the stuck process and now I am able to modprobe zfs correctly.
    – user533733
    Commented Nov 3, 2022 at 22:32

1 Answer 1

0

Figured it out, it was an update that installed the 5.10.0-19-amd64 so I needed to reboot.

You must log in to answer this question.