[Solved] Support of Trim on my SSD hardware?

Hi everybody,

I need an answer. I have a Samsung 840 pro SSD, and I would like to know if the trim is supported on this device with Linux.

I ran the hdparm -I /dev/sda command under the terminal, and in the results I have this:

Commands / features:
Enabled Supported:
* Data Set Management TRIM supported (limit 8 blocks)

So, does it means that Trim is well supported on my SSD ?

Thanks.

Yes, TRIM is supported. However, it is best not to use the discard mount option in /etc/fstab and to use systemd's fstrim.timer instead.

discard attempts a TRIM on every write, which not only impedes performance but may also fail if the number of blocks to be discarded is too small. fstrim.timer on the other hand runs once a week ─ usually Sunday at midnight, or upon the next boot if the machine was not powered up around that time.

In order to enable fstrim.timer, all you need to do is… :arrow_down:

sudo systemctl enable --now fstrim.timer

… and, as I said, remove discard from the mount options for your filesystems in /etc/fstab. :wink:

5 Likes

I’ve recently done a new install, I’ve realized that the discard option wasn’t by default anymore in my fstab file.
In addition, I start fstrim.timer with:

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

After reading the first post I’ve been curious about this, so I’ve checked the systemd settings and I’ve found this:

It seems that fstrim.timer runs every day instead of once time per week… Am I wrong?

Regards!! :grinning:

1 Like

You can cover both of those commands with the single command… :arrow_down:

sudo systemctl enable --now fstrim.timer

:wink:

Yes, the timer runs every day, but the service is run only once a week. The service is what does the trimming. The timer is only there so as to determine when the service must be run. :wink:

7 Likes

Ok, I see… Thank you very much for the info!!! :grinning: :grinning:

2 Likes

@Aragorn: OK, is that I just wanted to know. :wink:

I know that I must use fstrim.timer rather that discard option. Thanks to remind me. :grin:

The subject can be closed.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.