How to find and pin ZFS kernel that is not broken

Hi folks,

I usually run NixOS stable with a stable kernel but I have a new laptop and I need a more current kernel and I use ZFS.

I quickly noticed that zfs-kernel-##### is marked as broken, refusing to evaluate.

I tried to pin kernel and ZFS package to the same (older) revision like this:

  oldPkgs = import
    (builtins.fetchTree {
      type = "github";
      owner = "nixos";
      repo = "nixpkgs";
      rev = "........";
    })
    {
      config = { allowBroken = false; allowUnfree = false; };
      system = "x86_64-linux";
    };

but I’m getting the same error even for 2.2.4-6.9.7, etc…

Should I just finger crossed and install broken ZFS kernel 6.10 and hope that I won’t run into some issues? Or do you know about a revision where the ZFS kernel wasn’t broken?

Thank you.

zfs2.2.4 only support kernel 3.10-6.8
you can find the supported kernel version here zfs/META at b3b7491615308d80e363854e977387f633ad9327 · openzfs/zfs · GitHub
zfs2.2.5 support 6.10

boot.kernelPackages = pkgs.zfs.latestCompatibleLinuxPackages # or not config, it will use the lts kernel.

if you want to pin, you need to set boot.zfs.package = oldPkgs.zfs and boot.kernelPackages = oldPkgs.linuxPackages

zfs on stable is 2.2.4 you need set oldPkgs to unstable to use zfs 2.2.5

Thank you @iamai , I didn’t think it is actually possible to build ZFS with unsupported kernel version. Now it makes sense.

Does anybody here use the “broken” ZFS kernel 6.10? Does it work well for you?

Thx!

Using zfs on an unsupported kernel will turn your data into the test subject.
It’s unsupported for a reason :slight_smile:
If you’re able to risk data loss, then feel free to use it.

@foobar I’d at least wait for zfs-kernel-2.2.5-6.10. 2.2.5 won’t support ZFS (for that you need to wait for 2.2.6) but it’ll less likely damage your zpool.