Filesystems: Difference between revisions

Pigs (talk | contribs)
Move ssd trim information from nixos-generate-config wiki page
Pigs (talk | contribs)
m SSD TRIM support: don't mention filesystem specific mount options
 
(One intermediate revision by the same user not shown)
Line 69: Line 69:
=== SSD TRIM support ===
=== SSD TRIM support ===


If you are using an SSD it may be useful to enable [https://en.wikipedia.org/wiki/Trim_(computing) TRIM] support as well as set filesystem flags to improve the SSD performance:
On NixOS, [https://en.wikipedia.org/wiki/Trim_(computing) TRIM] support is enabled by default by the {{nixos:option|services.fstrim.enable}} option. This periodically discards unused blocks on supported storage devices, helping to maintain SSD performance over time.
 
The trimming schedule is controlled by the {{nixos:option|services.fstrim.interval}} option. Continuous trimming (as set by the <code>discard</code>, see <code>man mount(8)</code>) mount option is not recommended as it can negatively impact SSD performance.
   
   
Additionally, setting <code>noatime</code> can reduce the number of disk writes and can improve system performance.
{{file|/etc/nixos/configuration.nix|nix|
{{file|/etc/nixos/configuration.nix|nix|
<nowiki>
<nowiki>
fileSystems."/".options = [ "noatime" "nodiratime" "discard" ];
fileSystems."/".options = [ "noatime" ];
</nowiki>
</nowiki>
}}
}}


= References =
= References =
<references />
<references />