Skip to main content
Topic: Discard or not discard ? (Read 480 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Discard or not discard ?

Hello,

I use Artix OpenRC XFCE on Ext4 for office, graphics, multimedia use :
Spoiler (click to show/hide)


Is it useful to add the discard option in /etc/fstab for my SSD drives (which support TRIM) ?
Spoiler (click to show/hide)

Some serious sites recommend against it.

Re: Discard or not discard ?

Reply #1
discard
           If set, causes discard/TRIM commands to be issued to the block device when blocks are freed. This is useful for
           SSD devices and sparse/thinly-provisioned LUNs.

https://wiki.archlinux.org/title/Solid_state_drive#TRIM

basically,
why not periodic trim?
if it's a new SSD it should be fine to use continuous trim

Re: Discard or not discard ?

Reply #2
I use discard. I've never thought about it much but from a quick read of the linked wiki page section, and the links from that, it seems performance is better with periodic trim IF you have have an over-provisioned or no where near full SSD. If you have a very active (writes) and pretty full SSD discard is better?

I'll just stick with discard for now but might look into it further at some point.

Re: Discard or not discard ?

Reply #3
Thank you LemonPie and gripped for your opinions and conclusions.

I have SSDs on several PCs; some are well filled, others not.

I just ran sudo hdparm -t --direct /dev/sda on an SSD 80% full before and after removing the discard option from /etc/fstab : I didn't see any noticeable difference in the results.

This disk worked for years with this option and I had never launched fstrim.

 

Re: Discard or not discard ?

Reply #4
Just so you know the most noob friendly way of knowing whether the ssd does garbage collection, if you delete something big like 5+gb and the LED will stay on for a second or two. Then you won't need to check trim and discard, at least on common usage.