On Sun, Apr 26, 2020 at 10:52 AM <tu...@posteo.de> wrote:
>
> Fstrim reports about 200 GiB of trimmed data.
>
> From the gut this looks quite a lot -- the whole
> partition is 256 GB in size.
>
> Smartclt report for the drive:
> Data Units Written:                 700,841 [358 GB]
>
> Each week 200 GiB fstrimmed data for a partition of
> 256 GB in size and since the beginning I have written
> only 358 GB to it.
>
> How does this all fit together?

It doesn't fit together, because the amount of space trimmed has
nothing to do with the amount of data written.

How much free space is there?  I would think that fstrim would just
trim all unused blocks on the filesystem.  Unless it maintained state
it would have no idea what has changed since the last time it was run,
so if you ran it 10 times in a row it would trim 200GiB each time.

Unless your NVMe is brain-dead the only real downside to running it
more often is the IO.  If you trim 200GiB of data 100x in a row the
99x after the first one should all be no-ops if the drive is
well-designed.  An fstrim should just be a metadata operation.

Now, not all flash storage is equally well-implemented, and I suspect
the guidelines to avoid running it often or using discard settings are
from those who either have really cheap drives, or ones from a long
time ago.  A lot of linux advice tends to be based on what people did
10+years ago, and a lot of linux design decisions get made to
accommodate the guy who wants everything to work fine on his 386+ISA
and SGI Indigo in his basement.

My suggestion would be to run fstrim twice in a row and see how fast
it operates and what the results are.  If the second one completes
very quickly that suggests that the drive is sane.  I'd probably just
run it daily in that case, but weekly is probably fine especially if
the drive isn't very full.

-- 
Rich

Reply via email to