You are not logged in.

#1 2015-12-10 04:20:26

mindstormer
Member
Registered: 2015-05-28
Posts: 28

[Solved]How to test if implementation of TRIM via discard is working?

I read through the relevant Arch WIki entries on TRIM and there are a few things I need to do in particular for an LVM on LUKS setup to enable discard method (I don't think my Samsung 850 Pro 512 GB would suffer too much from using discard--would love to know if anyone things otherwise and would recommend fstrim over discard). My question is: how can I be sure TRIM via discard method is working 100%? I did some googling and found that there are some "tests" that can be performed--unfortunately, all of these small tests that I've come across do not seem to be accurate (they may say TRIM is working when it isn't based on another test, etc.).

Some users have recommended to simply run "fstrim -v /" and if it returns no errors, then TRIM is working, regardless of output. Others have yet that with this method, you need to get specific outputs in order to draw that conclusion (and run it more than once). Is running "fstrim -v /" a definite test for the proper implementation of TRIM? If so, what kind of output should I be looking at? What complicates this matter slightly further is that apparently the command behaves differently depending on the brand/type of SSD.

Thanks.

Last edited by mindstormer (2015-12-11 20:54:04)

Offline

#2 2015-12-10 14:17:31

TheChickenMan
Member
From: United States
Registered: 2015-07-25
Posts: 354

Re: [Solved]How to test if implementation of TRIM via discard is working?


If quantum mechanics hasn't profoundly shocked you, you haven't understood it yet.
Niels Bohr

Offline

#3 2015-12-11 00:44:00

mindstormer
Member
Registered: 2015-05-28
Posts: 28

Re: [Solved]How to test if implementation of TRIM via discard is working?

Thanks, I actually came across that post in my googling but was wondering if there's a simpler way to test the implementation of TRIM, such as using `fstrim -v /`. If there are no more responses, then I'll do both to check, though I don't know what kind of outputs I should expect from `fstrim -v/` if I can use it to test for trim via discard method.

Offline

#4 2015-12-11 01:48:10

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [Solved]How to test if implementation of TRIM via discard is working?

From my experience if you do 'fstrim -v /' and it doesn't complain then you have things setup properly and you can either use the discard option or the periodic fstrim. Which one you will have advantages and drawbacks but I'll leave that research to you wink

Regarding what you read back from the ssd after trim it depends on the ssd, some return zeros right after trim, others will return zeros only after they got around to actually doing some garbage collection and others might always return garbage or some fixed pattern.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#5 2015-12-11 20:51:39

mindstormer
Member
Registered: 2015-05-28
Posts: 28

Re: [Solved]How to test if implementation of TRIM via discard is working?

Thanks for the information--i'll use both and report back if there are conflicting results when I get the chance.

Offline

#6 2015-12-12 02:24:05

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [Solved]How to test if implementation of TRIM via discard is working?

Using both doesn't hurt but it's not needed. If you use the discard option then there should not be anything to trim periodically. The discard operation might still take time though, as the filesystem doesn't keep track of which sectors have been trimmed already (at least ext4 doesn't).


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#7 2015-12-12 06:17:48

mindstormer
Member
Registered: 2015-05-28
Posts: 28

Re: [Solved]How to test if implementation of TRIM via discard is working?

I mean using both the fstrim command and the method described from the stackexchange thread to check if TRIM via discard is implemented correctly smile

Last edited by mindstormer (2015-12-12 07:19:48)

Offline

Board footer

Powered by FluxBB