New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/zfs: Enable trim by default #69672
Conversation
c68dc37
to
b80808c
Compare
Assuming that more and more people will have SSDs/NVMEs this days this seems like a fair assumption. What do you think? @fpletz |
We also have |
I've been using ZFS trim since it was released, with the only data corruption being on 0.8.0 when combined with encryption. That one was resolved... Enabling fstrim by default would mean relying on every other filesystem to work, however. |
I feel a bit uneasy enabling this by default since it incurs a performance impact which is unnecessary for spinning disks. According to the related ZFS PR #8419, it will only do trim if the underlying block device supports discard though. If that works as intended 👍 from me. I wonder why ZoL disabled it by default then. Regarding |
which is probably why zfsonlinux does not enable |
Okay, thanks! 👍 |
Not to let "lower end devices" fool anyone: The fastest devices on the market are NVMe, and all the ones I've found guidance for say to use periodic trim, not continuous. |
I think this PR might have enabled zpool-trim on all systems regardless of whether they use ZFS. I just received a monitoring alert from all my NixOS machines saying that zpool-trim.service had failed execution :-) |
Motivation for this change
Trimming SSDs once per week should be safe in all cases, barring firmware or ZFS bugs. It's the default everywhere else.
Not trimming an SSD will wear it out much faster than necessary.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @