ZFS: Difference between revisions

EJIEK (talk | contribs)
m rm an extra bracket in the latest compatible Kernel selector left from the previous edit
34j (talk | contribs)
m replace urls with {{nixos:...}} templates
Line 1: Line 1:
[https://zfsonlinux.org/ {{PAGENAME}}] ([[wikipedia:en:{{PAGENAME}}]]), also known as [https://openzfs.org/ OpenZFS] ([[wikipedia:en:OpenZFS]]), is a modern filesystem which is well supported on [[NixOS]].
[https://zfsonlinux.org/ {{PAGENAME}}] ([[wikipedia:en:{{PAGENAME}}]]), also known as [https://openzfs.org/ OpenZFS] ([[wikipedia:en:OpenZFS]]), is a modern filesystem which is well supported on [[NixOS]].
[[category:filesystem]]
[[category:filesystem]]
Besides the ''zfs'' package (''ZFS Filesystem Linux Kernel module'') <ref>https://search.nixos.org/packages?channel=unstable&show=zfs&query=zfs</ref> itself, there are many packages in the ZFS ecosystem available.
Besides the {{nixos:package|zfs}} package (''ZFS Filesystem Linux Kernel module'') itself, there are many packages in the ZFS ecosystem available.


ZFS integrates into NixOS via the <code>boot.zfs</code><ref>https://search.nixos.org/options?channel=unstable&query=boot.zfs</ref> and <code>service.zfs</code><ref>https://search.nixos.org/options?channel=unstable&query=services.zfs</ref> options.
ZFS integrates into NixOS via the {{nixos:option|boot.zfs}} and {{nixos:option|services.zfs}} options.


== Limitations ==
== Limitations ==
Line 92: Line 92:
In low-memory situations, ZFS therefore might need a bit longer to free up memory from its cache. The swap partition will help with that.
In low-memory situations, ZFS therefore might need a bit longer to free up memory from its cache. The swap partition will help with that.


Example with gdisk:
Example with gdisk using <code>/dev/nvme0n1</code> as the device (use <code>lsblk</code> to find the device</code>):


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
Line 135: Line 135:
The operation has completed successfully.
The operation has completed successfully.
</syntaxhighlight>
</syntaxhighlight>
Final partition table
Final partition table (<code>fdisk -l /dev/nvme0n1</code>):
<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
Number  Start (sector)    End (sector)  Size      Code  Name
Number  Start (sector)    End (sector)  Size      Code  Name
Line 422: Line 422:
== Take snapshots automatically ==
== Take snapshots automatically ==


See <code>services.sanoid</code> section in <code>man configuration.nix</code>.
See {{nixos:option|services.sanoid}} section in <code>man configuration.nix</code>.


== NFS share ==
== NFS share ==