You are not logged in.

#1 2016-10-05 14:25:30

Espionage724
Member
From: Pennsylvania, United States
Registered: 2013-09-12
Posts: 20
Website

Trim and XFS?

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

#2 2016-10-05 15:08:14

frostschutz
Member
Registered: 2013-11-15
Posts: 1,409

Re: Trim and XFS?

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

#3 2016-10-05 19:03:59

Espionage724
Member
From: Pennsylvania, United States
Registered: 2013-09-12
Posts: 20
Website

Re: Trim and XFS?

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

Board footer

Powered by FluxBB