Artix Linux Forum

Artix Linux => System => Topic started by: tintin on 18 October 2023, 11:06:44

Title: Discard or not discard ?
Post by: tintin on 18 October 2023, 11:06:44
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.
Title: Re: Discard or not discard ?
Post by: LemonPie on 18 October 2023, 19:42:20
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
Title: Re: Discard or not discard ?
Post by: gripped on 18 October 2023, 22:31:06
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.
Title: Re: Discard or not discard ?
Post by: tintin on 19 October 2023, 04:48:39
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.
Title: Re: Discard or not discard ?
Post by: Hitman on 19 October 2023, 11:33:50
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.