I am trying to figure out mount options for a nvme drive. What is the preferred solution:
/etc/fstab or enabled
fstrim.timer? The man page on
fstrim cautions against using
discard. Same advice on the archlinux wiki page Solid state drive - ArchWiki. On the other hand, my system SATA SSD is mounted as follows:
UUID=40eaeac9-e00a-45ab-aa5f-d0c0c93ee1a4 / btrfs subvol=/@,defaults,discard=async,ssd 0 0
These options were set during Manjaro installation.
Continuous TRIM (discard) is never recommended.
Running fstrim from time to time - such as through the timer is recommended.
Why you have discard set automatically …
Ah found it … default since 6.2 …
reed extents are not discarded immediately, but grouped together and trimmed later by a separate worker thread, improving commit latency.
This quotation vaguely makes it sound as if this kind of discard may be ‘safe’ … but it doesnt directly say that or give any supporting information. (the linked fedora message only states ‘facebook has used it for 6 months’)
So … I’m still a bit skeptical.
What we can still note however is that you would only really need continuous TRIM in the case of constant heavy workload of reads and writes. For most users the weekly trim is quite acceptable … though it could also be noted you can augment that time to once daily, for example.
So, I have now another issue (provided Manjaro did it right for the system drive). If I create ext4 filesystem and enable
fstrim.timer, it will also trim the root filesystem, which would be bad. So either I have to modify fstrim.service, or change ext4 to btrfs on my new drive and mount it with the
discard option. By the way, the drive is destined to hold /home and the directory where I do development work.
Why would it be bad? In the case of many systems there is only a single partition ( / ) and thus the only thing being trimmed would be the root partition.
If you mean you dont want to mix it with the discard option… then it would seem to me that by the UUID and other mount options it would only pertain to each partition … but its also noted in the linked pages that the 2 (discard=async and fstrim.timer) can safely coexist.
OK, you are right. I did not click on that link. Thanks.