Why is ssd trim disabled by default?

Shouldn’t it be turned on by default?

sudo systemctl status fstrim.timer

● fstrim.timer - Discard unused blocks once a week
Loaded: loaded (/usr/lib/systemd/system/fstrim.timer; disabled; vendor preset: disabled)
Active: inactive (dead)
Trigger: n/a
Triggers: ● fstrim.service
Docs: man:fstrim

Check in /etc/fstab if you have the discard option for your SSD. Last time I checked, Manjaro does implement TRIM by default, but not this way.

They do not do the same thing. The timer does all the TRIM job once per week, and the discard option does the TRIM job much more continuously (it is issued each time files get deleted).

The timer way is arguably the most preferred way among the Linux community, and arguably the one preferred on many distributions, but I could not tell why Manjaro choose discard over following the trend.

It is useless to enable the timer if discard option is used. If you end up not using discard, well, enable the timer if you prefer using the timer.

2 Likes

And every time a file is modified. And there’s the problem. When the differences are too small, then the underlying storage medium may ignore the trim request. Using fstrim.timer instead ensures that there will be enough discarded blocks in the queue, and that the underlying device will effectively trim the blocks.

Another consideration is that the discard mount option reduces I/O performance. This too is why the fstrim.timer is preferred. :wink:

Yes, it should.

manjaro-xfce-20.1.2-201019-linux58.iso
There is no discard and

systemctl status fstrim.timer 
● fstrim.timer - Discard unused blocks once a week
     Loaded: loaded (/usr/lib/systemd/system/fstrim.timer; disabled; vendor preset: disabled)
     Active: inactive (dead)
    Trigger: n/a
   Triggers: ● fstrim.service
       Docs: man:fstrim
systemctl status fstrim.service 
● fstrim.service - Discard unused blocks on filesystems from /etc/fstab
     Loaded: loaded (/usr/lib/systemd/system/fstrim.service; static)
     Active: inactive (dead)
       Docs: man:fstrim(8)

Is it supposed to be like this?

No. Is it on your installed system?

Yes, this is my real computer with SSD, not VirtualBox.

I was just wondering if this was from the ISO or the system once installed. I’ll try to find where this is packaged to see the official defaults.

Installed system, not ISO.

Try enabling it?

systemctl enable --now fstrim.timer

The problem is not that cannot enable it, that it should work by default. Or again some non-standard trim is used, or what is bug or not?

No, fstrim should be enabled by default. It’s in the iso-profile, if it is not enabled it is a bug.

Is it possible to find out why this is happening?

We had a bad batch of release candidate isos where it was disabled. It was supposed to be disabled only for the live system, but it got disabled for the installed version as well, along with snapd, tlp, pkgfile and so on. The issue is fixed with the next release which is scheduled to happen next weekend.

3 Likes

Well, I will test the next stable release.