ZFS: Difference between revisions
m Formatting, grammar, etc. |
Update guidance around Kernel versions |
||
Line 8: | Line 8: | ||
==== Latest Kernel compatible with ZFS ==== | ==== Latest Kernel compatible with ZFS ==== | ||
ZFS often does not support the latest Kernel versions. It is recommended to use an LTS Kernel version whenever possible; the NixOS default Kernel is generally suitable. See [[Linux kernel|Linux Kernel]] for more information about configuring a specific Kernel version. | |||
If your config specifies a Kernel version that is not officially supported by upstream ZFS, the ZFS module will fail to evaluate with an error that the ZFS package is "broken". | |||
===== Selecting the latest ZFS-compatible Kernel ===== | |||
{{Warning|This will often result in the Kernel version going backwards as Kernel versions become end-of-life and are removed from Nixpkgs. If you need more control over the Kernel version due to hardware requirements, consider simply pinning a specific version rather than calculating it as below.}} | |||
To use the latest ZFS-compatible Kernel currently available, the following configuration may be used. | |||
} | |||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
Line 56: | Line 46: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===== Using unstable, pre-release ZFS ===== | |||
{{Warning|Pre-release ZFS versions may be less well-tested, and may have critical bugs that may cause data loss.}} | |||
In some cases, a pre-release version of ZFS may be available that supports a newer Kernel. Use it with <code>boot.zfs.package = pkgs.zfs_unstable;</code>. | |||
==== Partial support for swap on ZFS ==== | ==== Partial support for swap on ZFS ==== |