Filesystem recommendations

What is “the recommended” filesystem to install nixos on?

  • ext4 seem just too outdated
  • btrfs ?
  • zfs ?

ZFS is great, however it lacks an installation guide. wiki presents a guide that forces an overcomplicated config on a beginner, and doesn’t help at all to understand what is actually happening. (I myself seem to have caught a version of that guide that was not yet overcomplicated, but i’m using legacy mountpoints and simple fileSystem.<mntpoin> = {} kind of simplest configuration)

I don’t think there’s a recommendation that differs from your usual filesystem recommendations for Linux systems. I think it roughly is:

  • ext4 if you want a filesystem that just does expected filesystem things. Especially if you don’t really know what either of these things are or do.
  • btrfs if you want a filesystem that does everything you think a filesystem does, but also near-zero cost snapshots, compression, copy-on-write, etc.
  • zfs if you want btrfs’ features, but with licensing issues forcing you into third party kernel modules, in exchange for a few additional features and different performance characteristics.

I don’t think NixOS makes either of the filesystems particularly more or less interesting than normal. If anything, it makes ext4’s lack of snapshots less problematic, and zfs’ licensing issues a bit less problematic since there are a fair few zfs users among us.

1 Like

I’ve started using btrfs for all new installs I’m doing. From my research, it seems to be the sweet spot right now, other than certain RAID setups which it apparently doesn’t handle very well yet.

If you don’t need legacy ext4 support, and don’t need specific advanced features that ZFS or XFS would bring, then I’d say go with btrfs.

1 Like

One of the reasons I prefer btrfs over zfs for NixOS is because encrypted boot with zfs is tricky on NixOS, since the native encryption doesn’t work via LUKS and therefore falls flat in the face of the default init scripts (and afaict systemd can’t decrypt it at all yet, which will probably be a more significant problem in the future). My bad, @uep says it does work.

Block-based encryption is a really enticing feature though, maybe one day. Or btrfs gets block-based encryption one day, who knows?

Also the zfs instructions are indeed awkward, what with its pre-written system configuration that isn’t composable at all and lacks any explanations. As much as I understand their desire to minimize documentation maintenance overhead and complexity, the current state is awful.

1 Like

Thank you for advices
What i look for in an FS is:

  • no file corruption on power failures (and other unexpected kernel oopsies)
  • ability to change physical shape of a logical partition (resize, move from one drive to another or to multiple)
  • snapshots (though with nixos i’m not sure i need that)
  • copy on write (it’s just cool)

and a separate application:

  • long term cold-ish backups and ability to detect bit flips and other unexpected physical errors.

zfs seem cool, but having it as dkms already caused a little bit of hassle for me (not on nixos)
never tried btrfs actually…

Just for clarity: both zfs native encryption and zfs-on-luks work fine, with both nixos scripted and systemd stage1 options. I’m typing this now on one of several systems using zfs native encryption and stage1 systemd.

I won’t dispute assertions about the beginner view of various installation guides; I was already well familiar with, and had strong opinions of my own about, zfs configurations before switching to nixos, so my view of the guides was very much more focused only on certain nixos-specific items.

And, yes, for me one of the very big advantages of zfs is the send/recv functionality for backup replication.


Much less so for os root config, but no less so than any other platform for your actual data.


Hrm, guess I’ll have to try that again.