ZFS: Difference between revisions

imported>Iimog
Add documentation for potential boot error as discussed in https://nixos.org/nix-dev/2017-January/022591.html
imported>Sjau
Adding ZFS Trimming
Line 435: Line 435:


to the iso's configuration.nix followed by a <code>nixos-rebuild switch</code> ([https://discourse.nixos.org/t/install-report-from-new-user/1390/9 source])
to the iso's configuration.nix followed by a <code>nixos-rebuild switch</code> ([https://discourse.nixos.org/t/install-report-from-new-user/1390/9 source])
== ZFS Trim for SSDs ==
Currently a [https://github.com/zfsonlinux/zfs/pull/8419 patch for zfs] is being tested which allows the trimming for ssd drives. It's still being tested and not yet included in the zfs git-master. Testing so far has been positive and if you want to try - at your own risk - you can do so easily.
=== Apply ZFS Trim patch ===
1. Create a clone of Nixos git-master
2. Create a new branch, e.g. <code>git checkout -b zfs-trim-patch</code>
3. Get the zfs default.nix with trim patch, e.g. <code>curl -o ./pkgs/os-specific/linux/zfs/default.nix https://www.sjau.ch/zfs/default.nix</code>
4. Rebuild Nixos, e.g. <code>nixos-rebuild boot -I pkgs=/root/nixos-git-master</code>
Of course use appropriate paths for your system.
=== How to use ZFS trimming ===
ZFS trimming works on one or more zpools and will trim each ssd inside it. There are two modes of it. One mode will manually trim the specified pool and the other will auto-trim pools. However the main difference is, that auto-trim will skip ranges that it considers too small while manually issued trim will trim all ranges.
To manually start trimming of a zpool run: <code>zpool trim tank</code>
To set a pool for auto-trim run: <code>zpool set autotrim=on tank</code>
To check the status of the manual trim, you can just run <code>zpool status -t</code>
To see the effects of trimming, you can run <code>zpool iostat -r</code> and <code>zpool iostat -w</code>
To see whether auto-trimming works, just run <code>zpool iostat -r</code> note the results and run it later again. The trim entries should change.
For further information read the [https://github.com/zfsonlinux/zfs/pull/8419 PR description].


== Need more info? ==
== Need more info? ==