On 04/26 11:20, Rich Freeman wrote: > 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 >
Hi Rich, thanks for explanation. My observations does not fit with your explanation, though. Early in the morning I did a fstrim, which results in the 200GiB of freed data. Base on you posting I did a fstrim now with no wait in between: host:/root>fstrim -v / /: 3.3 GiB (3578650624 bytes) trimmed host:/root>fstrim -v / /: 0 B (0 bytes) trimmed This time the first fstrim reports a small mount of trimmed data and second one no fstrimmed data at all. The SSD is a ADATA Technology Co., Ltd. XPG SX8200 Pro PCIe Gen3x4 M.2 2280 Solid State Drive (rev 03) (cut'n'paste from `lspci`) host:/root>df -h / Filesystem Size Used Avail Use% Mounted on /dev/root 246G 45G 189G 20% / Cheers! Meino