Do I need to use TRIM?

should I enable TRIM for my SSD drives on EOS?
(fstrim.service)

Yes :slightly_smiling_face:

Some explanation why: https://linuxhint.com/ssd_trim/

Also: https://wiki.archlinux.org/index.php/TRIM

6 Likes

Absolutely yes, but if you enable fstrim make sure that discard (continuous TRIM) is disabled for your disks in /etc/fstab

for example if you see entry like:

UUID=ebf74332-5a35-422b-9b69-63412f2a6900 /              ext4    defaults,noatime,discard 0 1

Just remove discard

UUID=ebf74332-5a35-422b-9b69-63412f2a6900 /              ext4    defaults,noatime 0 1
11 Likes

i can only try making some marketing for our WIKI:

10 Likes

I am confused, I was under the assumption trim is enabled by default for SSD’s? Or is this not the case?

Yes it is, the one called continuous TRIM ( /etc/fstab ), however it is recommended to disable it (solution) and use periodic TRIM with fstrim.service

1 Like

Hmm - discard wasn’t there.

Ran hdparm -I /dev/sda
image

Is there another method for determining the type of trim being enabled? Little skeptical of doing the arch wiki method as it mentions (warns) that you might experience data loss running that command.

That’s pretty weird though, by default Arch should use discard for any SSD / NVME drives…

For continuous TRIM that’s pretty much it:

cat "/etc/fstab" | grep -E "discard"

Should return nothing if it’s not in use.


For checking if periodic TRIM is enabled:

systemctl status fstrim.timer

Should be Loaded and Active

2 Likes

Ran: cat “/etc/fstab” | grep -E “discard”

Just came back to another prompt, nothing appeared.

Ran systemctl status fstrim.timer - looks like its not active.

To enabled periodic TRIM

sudo systemctl enable fstrim.timer
sudo systemctl start fstrim.timer

Then try again, should be working

systemctl status fstrim.timer

P.S. You can also change weekly to daily here in that file, but weekly should be fine:

cat "/usr/lib/systemd/system/fstrim.timer"
2 Likes

Sorry for jacking the thread but like this topic.

So now its enabled, does this require any intervention to have it run automatically on reboot?

1 Like

Nope, should be working just fine on every boot now, well you can test it of course :slight_smile:

P.S. Once i’ll get more time i’ll make a writeup on drives…That topic is hot for a reason :fire:

2 Likes

appreciate it - just weird that it wasn’t set to discard or fstrim

2d4

1 Like