# PSA: Nix on XFS on ZFS

**URL:** https://discourse.nixos.org/t/psa-nix-on-xfs-on-zfs/78642
**Category:** Links
**Created:** [June 29, 2026, 11:05am UTC](https://discourse.nixos.org/t/psa-nix-on-xfs-on-zfs/78642 "2026-06-29T11:05:10Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![MagicRB](https://discourse.nixos.org/user_avatar/discourse.nixos.org/magicrb/32/6884_2.png) [@MagicRB](https://discourse.nixos.org/u/MagicRB)
#### Post date: [June 29, 2026, 11:05am UTC](https://discourse.nixos.org/t/psa-nix-on-xfs-on-zfs/78642/1 "2026-06-29T11:05:11Z")

</div>

> **[PSA: Nix on XFS on ZFS](https://redalder.org/blog/psa_nix_on_xfs_on_zfs.html)**

---

<div class="post-metadata">

### Author: ![Mapybara](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/m/8dc957/32.png) [@Mapybara](https://discourse.nixos.org/u/Mapybara)
#### Post date: [June 29, 2026, 11:11am UTC](https://discourse.nixos.org/t/psa-nix-on-xfs-on-zfs/78642/2 "2026-06-29T11:11:06Z")

</div>

Fun!

Pretty sure you already know this, but an alternative is to tune a separate ZFS dataset to perform well with databases (at the expense of small files, which is why you make it a separate dataset) - see [Tuning recordsize in OpenZFS - Klara Systems](https://klarasystems.com/articles/tuning-recordsize-in-openzfs/) for a random example article.

---

<div class="post-metadata">

### Author: ![MagicRB](https://discourse.nixos.org/user_avatar/discourse.nixos.org/magicrb/32/6884_2.png) [@MagicRB](https://discourse.nixos.org/u/MagicRB)
#### Post date: [June 29, 2026, 11:13am UTC](https://discourse.nixos.org/t/psa-nix-on-xfs-on-zfs/78642/3 "2026-06-29T11:13:52Z")

</div>

Yep, I do, I do that for PostgreSQL, where I have found 8k to work well. But I haven’t really found anyone talking about what is the correct tuning for SQLite and honestly, I couldn’t be arsed to find out :D. So I just slapped it on XFS.

---

<div class="post-metadata">

### Author: ![furanchuchu](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/f/59ef9b/32.png) [@furanchuchu](https://discourse.nixos.org/u/furanchuchu)
#### Post date: [June 29, 2026, 12:43pm UTC](https://discourse.nixos.org/t/psa-nix-on-xfs-on-zfs/78642/4 "2026-06-29T12:43:31Z")

</div>

How did the thought of moving it to XFS occur to you in the first place? What’s the reasoning here?

I use ZFS and face similar issues, but I would never think about this.

Sorry if the question is stupid but I’m no filesystems expert.

---

<div class="post-metadata">

### Author: ![norpol](https://discourse.nixos.org/user_avatar/discourse.nixos.org/norpol/32/8764_2.png) [@norpol](https://discourse.nixos.org/u/norpol)
#### Post date: [June 29, 2026, 12:49pm UTC](https://discourse.nixos.org/t/psa-nix-on-xfs-on-zfs/78642/5 "2026-06-29T12:49:47Z")

</div>

FYI the ZFS sqlite performance issues should be resolved with 2.4.0

> <https://github.com/atuinsh/atuin/issues/3036>
>
> Good news! 🎉 
> 
> In #952 (locked so posting new issue), @ellie mentioned:
> 
> \> We wi…ll likely consider deprecating + removing it as soon as the issue with ZFS is resolved
> 
> The ZFS issue has now been resolved. PR https://github.com/openzfs/zfs/pull/17584 by Rob Norris (Klara, Inc. / Wasabi Technology, Inc.) was merged and included in ZFS 2.4.0 (released 2025-12-18):
> 
> | Commit | Description |
> |--------|-------------|
> | \[\`fb7a8503bcfb\`\](https://github.com/openzfs/zfs/commit/fb7a8503bcfb) | Linux: zfs\_putpage: complete async page writeback immediately |
> | \[\`a18c9edda621\`\](https://github.com/openzfs/zfs/commit/a18c9edda621) | Linux: sync: remove async/sync accounting |
> | \[\`c3496b5cc6f8\`\](https://github.com/openzfs/zfs/commit/c3496b5cc6f8) | Linux: zfs\_putpage: document (and fix!) confusing sync/commit modes |
> | \[\`7ac5440ecf53\`\](https://github.com/openzfs/zfs/commit/7ac5440ecf53) | ZTS: mmap\_ftruncate test to confirm async writeback behaviour |
> 
> The fix unlocks pages immediately once data is in the DMU/ZIL, rather than waiting for the ZIL itx callback. This eliminates the \`ftruncate()\` blocking on mapped page writeback that caused 500ms-5s delays at every shell prompt.
> 
> Root cause: https://github.com/openzfs/zfs/issues/14290
> 
> Users on ZFS 2.4.0+ should no longer need:
> \- Atuin daemon mode
> \- \`sync=disabled\` workaround
> \- ext4 zvol workaround
> \- \`zfs\_txg\_timeout\` tuning
> 
> Is deprecating the daemon still on the table?

> <https://github.com/openzfs/zfs/issues/14290>
>
> \### System information
> 
> Type | Version/Name
> --- | ---
> Distribution Name	| F…edora
> Distribution Version	| 36
> Kernel Version	| 5.15.82
> Architecture	|x86\_64
> OpenZFS Version	|2.1.7
> 
> 
> \### Describe the problem you're observing
> Usually \`rpm\` commands execute quickly, but pretty often (10% of the cases) there is 4 second extra delay:
> \`\`\`
> 16:22:55.694445 openat(AT\_FDCWD, "/usr/lib/sysimage/rpm/rpmdb.sqlite-shm", O\_RDWR|O\_CREAT|O\_NOFOLLOW|O\_CLOEXEC, 0644) = 6 \<0.000086\>
> 16:22:55.694563 newfstatat(6, "", {st\_dev=makedev(0, 0x1e), st\_ino=27231358, st\_mode=S\_IFREG|0644, st\_nlink=1, st\_uid=0, st\_gid=0, st\_blksize=131072, st\_blocks=18, st\_size=32768, st\_atime=1671114175 /\* 2022-12-15T16:22:55.105109260+0200 \*/, st\_atime\_nsec=105109260, st\_mtime=1671114175 /\* 2022-12-15T16:22:55.106109257+0200 \*/, st\_mtime\_nsec=106109257, st\_ctime=1671114175 /\* 2022-12-15T16:22:55.106109257+0200 \*/, st\_ctime\_nsec=106109257}, AT\_EMPTY\_PATH) = 0 \<0.000011\>
> 16:22:55.694692 geteuid() = 0 \<0.000010\>
> 16:22:55.694759 fchown(6, 0, 0) = 0 \<0.000047\>
> 16:22:55.694855 fcntl(6, F\_GETLK, {l\_type=F\_UNLCK, l\_whence=SEEK\_SET, l\_start=128, l\_len=1, l\_pid=0}) = 0 \<0.000010\>
> 16:22:55.694909 fcntl(6, F\_SETLK, {l\_type=F\_WRLCK, l\_whence=SEEK\_SET, l\_start=128, l\_len=1}) = 0 \<0.000009\>
> 16:22:55.694953 ftruncate(6, 3) = 0 \<4.372489\>
> \`\`\`
> 
> I have ZFS as root fs running on top of \*\*LUKS2\*\*. NVMe Corsair MP510 (Max Random Write QD32 IOMeter: Up to \_440K\_ IOPS) with practically zero other IO operations when I run \`rpm\`.
> 
> \### Describe how to reproduce the problem
> Just try rpm again.
> 
> \### Include any warning/errors/backtraces from the system logs
> 
> zpool show no errors and:
> \`\`\`
> NAME PROPERTY VALUE SOURCE
> tank type filesystem -
> tank creation Wed Nov 10 15:40 2021 -
> tank used 1.39T -
> tank available 296G -
> tank referenced 96K -
> tank compressratio 1.29x -
> tank mounted no -
> tank quota none default
> tank reservation none default
> tank recordsize 128K default
> tank mountpoint /tank default
> tank sharenfs off default
> tank checksum on default
> tank compression zstd-3 local
> tank atime on default
> tank devices on default
> tank exec on default
> tank setuid on default
> tank readonly off default
> tank zoned off default
> tank snapdir hidden default
> tank aclmode discard default
> tank aclinherit restricted default
> tank createtxg 1 -
> tank canmount off local
> tank xattr sa local
> tank copies 1 default
> tank version 5 -
> tank utf8only on -
> tank normalization formD -
> tank casesensitivity sensitive -
> tank vscan off default
> tank nbmand off default
> tank sharesmb off default
> tank refquota none default
> tank refreservation none default
> tank guid 8575689710526589949 -
> tank primarycache all default
> tank secondarycache all default
> tank usedbysnapshots 0B -
> tank usedbydataset 96K -
> tank usedbychildren 1.39T -
> tank usedbyrefreservation 0B -
> tank logbias latency default
> tank objsetid 54 -
> tank dedup off default
> tank mlslabel none default
> tank sync standard default
> tank dnodesize auto local
> tank refcompressratio 1.00x -
> tank written 0 -
> tank logicalused 1.77T -
> tank logicalreferenced 42K -
> tank volmode default default
> tank filesystem\_limit none default
> tank snapshot\_limit none default
> tank filesystem\_count none default
> tank snapshot\_count none default
> tank snapdev hidden default
> tank acltype posix local
> tank context none default
> tank fscontext none default
> tank defcontext none default
> tank rootcontext none default
> tank relatime on local
> tank redundant\_metadata all default
> tank overlay on default
> tank encryption off default
> tank keylocation none default
> tank keyformat none default
> tank pbkdf2iters 0 default
> tank special\_small\_blocks 0 default
> \`\`\`

---

<div class="post-metadata">

### Author: ![MagicRB](https://discourse.nixos.org/user_avatar/discourse.nixos.org/magicrb/32/6884_2.png) [@MagicRB](https://discourse.nixos.org/u/MagicRB)
#### Post date: [June 29, 2026, 12:55pm UTC](https://discourse.nixos.org/t/psa-nix-on-xfs-on-zfs/78642/6 "2026-06-29T12:55:59Z")

</div>

I’ve been running ZFS on everything for nearly 5 years and i maintain a sizable homelab (more like homeprod these days). I’ve had issues with zfs performance in the past, especially when it comes to databases. A database like sqlite and postgres are actually somewhat similar to zfs. The internal data layout is different, but they both keep a write ahead log, journal, zfs intent log, whatever you want to call it. It’s purpose is to allow the program to quickly and reliably make sure that all changes make it to disk when desired. Then, the log is applied to the actual on-disk datastore.

But yeah, honestly, mostly a hunch. If i had more time on my hands, way more time, id also attempt to write a patch for Nix which allows it to store store paths in a prefix form. So instead of `/nix/store/aaaaaaaa` youd have `/nix/store/aa/aaaaaa` which should help with the ZAP (data structures zfs uses for directory lookups). Youd also need a kernel module which undoes this prefixing so it still looks like a normal store to the rest of the system.

---

<div class="post-metadata">

### Author: ![MagicRB](https://discourse.nixos.org/user_avatar/discourse.nixos.org/magicrb/32/6884_2.png) [@MagicRB](https://discourse.nixos.org/u/MagicRB)
#### Post date: [June 29, 2026, 12:56pm UTC](https://discourse.nixos.org/t/psa-nix-on-xfs-on-zfs/78642/7 "2026-06-29T12:56:25Z")

</div>

I’ll check, i might be on 2.4 already. Will update this comment when I do.

---

<div class="post-metadata">

### Author: ![MagicRB](https://discourse.nixos.org/user_avatar/discourse.nixos.org/magicrb/32/6884_2.png) [@MagicRB](https://discourse.nixos.org/u/MagicRB)
#### Post date: [June 29, 2026, 4:27pm UTC](https://discourse.nixos.org/t/psa-nix-on-xfs-on-zfs/78642/8 "2026-06-29T16:27:38Z")

</div>

@norpol yes i am:

```auto
zfs-2.4.3-1
zfs-kmod-2.4.1-1

```
