SSD and TRIM

Archived topics about LMDE 1 and LMDE 2
Locked
tsapi

SSD and TRIM

Post by tsapi »

Good evening,

I made a fresh install of LMDE2/64 (cinnamon) on a new SSD some months ago. A couple of months later, I installed a second SSD in that PC.

My questions are:

1. Has TRIM been taken care of for the first SSD during the installation? How can I check it? If no, how should I "enable" it?

2. How should I "enable" TRIM for the second SSD I added?

Thanks a lot in advance for any help provided! :wink:

tsapi
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
greerd
Level 6
Level 6
Posts: 1060
Joined: Sat Jul 31, 2010 10:58 am
Location: Nova Scotia, Canada

Re: SSD and TRIM

Post by greerd »

Hi tsapi,

If you look in /etc/cron.weekly/ you should see a file called fstrim. The file contains the command '/sbin/fstrim --all || true' which should trim all mounted file systems that support it. If you feel a weekly run isn't often enough, you could move the file into the /etc/cron.daily/ directory. (which is what I did).

Cheers
tsapi

Re: SSD and TRIM

Post by tsapi »

greerd wrote: If you look in /etc/cron.weekly/ you should see a file called fstrim. The file contains the command '/sbin/fstrim --all || true' which should trim all mounted file systems that support it. If you feel a weekly run isn't often enough, you could move the file into the /etc/cron.daily/ directory. (which is what I did).
Hi greerd!
Thanx a lot for the input, but..

Code: Select all

zmpit cron.weekly # find / -name fstrim*
/sbin/fstrim
/usr/share/bash-completion/completions/fstrim
/usr/share/man/man8/fstrim.8.gz
/usr/share/doc/util-linux/examples/fstrim.timer
/usr/share/doc/util-linux/examples/fstrim.service
zmpit cron.weekly # 
So, after a bit of googling I came to the conclusion that what you are describing is the case in ubuntu distros (I am running LMDE2).

The "debian way" (which is the case for LMDE2) must be following:

Code: Select all

zmpit cron.weekly # cp /usr/share/doc/util-linux/examples/fstrim.service /etc/systemd/system
zmpit cron.weekly # cp /usr/share/doc/util-linux/examples/fstrim.timer /etc/systemd/system
zmpit cron.weekly # systemctl enable fstrim.timer
Created symlink from /etc/systemd/system/multi-user.target.wants/fstrim.timer to /etc/systemd/system/fstrim.timer.
zmpit cron.weekly # 
So I suppose the job is done, right?
User avatar
greerd
Level 6
Level 6
Posts: 1060
Joined: Sat Jul 31, 2010 10:58 am
Location: Nova Scotia, Canada

Re: SSD and TRIM

Post by greerd »

Sytemd, I didn't think of that, I'm not sure if your correct or not. Yes Ubuntu based Mint 18.1, which comes default with /etc/cron.weekly/fstrim.
I would expect that if you open a terminal and enter 'sudo fstrim -v /' and you get output, then the command I mentioned above would work if you put it in a file like so:

Code: Select all

#!/bin/sh
# trim all mounted file systems which support it
/sbin/fstrim --all || true
and made it executible of course.

See Pjotr's Linux Tips for more info.
Locked

Return to “LMDE Archive”