You are not logged in.
Pages: 1
On ext4 and F2FS with a basic partition layout (GPT, no LVM, F32 /boot, /, and swap partitions) running fstrim reports a large size as trimmed on the first run, and then something much smaller on another run right after that. For a more specific example (fstrim was ran 3 times in a row):
fstrim / -v
/: 54.1 GiB (58119434240 bytes) trimmed
fstrim / -v
/: 44 KiB (45056 bytes) trimmed
fstrim / -v
/: 0 B (0 bytes) trimmed
With a XFS root partition, fstrim doesn't report a smaller value. It reports the same value it reported last time. If I run the command a second time or sync, it does seem to take a little while to complete as if something is/did happen, but the value reported by fstrim doesn't change.
Does fstrim on XFS work?
Last edited by Espionage724 (2016-10-05 14:26:39)
RoE | Wiki - My Linux set-up tweaks and notes!
Offline
Yes, it works fine.
Some filesystems keep track of what they trimmed, and don't trim it again - others do not. Thus the number of bytes trimmed, does not say much. (TRIM might still work even if it says 0 bytes trimmed.)
fstrim does not make the decision what / how much to trim... fstrim just tells the filesystem to trim itself, and whatever actually happens is up to the filesystem itself.
You can use this method to test it: http://unix.stackexchange.com/a/85880/30851
Last edited by frostschutz (2016-10-05 15:09:20)
Offline
Thanks for the information and that link. I used the test script at the bottom of that post and it does look like trim is working.
RoE | Wiki - My Linux set-up tweaks and notes!
Offline
Pages: 1