Welcome!
Important information
-- Spectre and Meltdown vulnerabilities
-- Change in MX sources

News
-- MX Linux on social media: here
-- Mepis support still here

Current releases
-- MX-17.1 Final release info here
-- antiX-17 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

ssd trim <Answered>

Help for Current Versions of MX
Message
Author
old_guy
Forum Novice
Forum  Novice
Posts: 36
Joined: Sat Oct 28, 2017 4:30 pm

ssd trim <Answered>

#1 Post by old_guy » Sun Sep 16, 2018 11:29 am

I just installed an ssd. I have my os on the ssd and my data on a hd. I read that you should run trim for the ssd and found that MX has fstrim-mx in /etc/cron.weekly. I don't keep my system on all the time and don't know when/how cron runs, so my question is how should I run trim (fstrim-mx) on my machine?

Earl
Last edited by old_guy on Tue Sep 18, 2018 12:43 pm, edited 1 time in total.

User avatar
fehlix
Forum Guide
Forum Guide
Posts: 1423
Joined: Wed Apr 11, 2018 5:09 pm

Re: ssd trim

#2 Post by fehlix » Sun Sep 16, 2018 11:40 am

old_guy wrote:
Sun Sep 16, 2018 11:29 am
I just installed an ssd. I have my os on the ssd and my data on a hd. I read that you should run trim for the ssd and found that MX has fstrim-mx in /etc/cron.weekly. I don't keep my system on all the time and don't know when/how cron runs, so my question is how should I run trim (fstrim-mx) on my machine?

Earl
Cron.weekly might be smart enough to run when it's over due.
Not sure how long you have to powered on the system to get trim triggered.
You'll find the run-log here:
/var/log/trim.log

I do actually prefere do have it run a bit more often.
It's more important, when you have not much space on the device left.
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

User avatar
chrispop99
Forum Guide
Forum Guide
Posts: 2364
Joined: Tue Jan 27, 2009 3:07 pm

Re: ssd trim

#3 Post by chrispop99 » Sun Sep 16, 2018 11:40 am

If trim is started by cron.weekly, it will be logged in var/log/trim.log.

I would suggest having a look in that log a month or so and see if a trim operation has occurred. If that wasn't the case, you could use cron.daily instead, but I think that would be overkill.

If you want to do it manually, execute this in a terminal as root:

Code: Select all

fstrim / -v
Chris
Test machines:
32-bit non-PAE - Thinkpad T41, 1.6GHz Pentium M, 1GB RAM.
32-bit PAE - DELL Latitude D610, 1.73GHz Pentium M, 2GB RAM.
64-bit - Lenovo T61, 2GHz Core 2 Duo, 2GB RAM
64-bit - Gigabyte Z77P-D3, Intel i3-3220, GeForce 8400 GS, 4GB PC3-12800.

User avatar
fehlix
Forum Guide
Forum Guide
Posts: 1423
Joined: Wed Apr 11, 2018 5:09 pm

Re: ssd trim

#4 Post by fehlix » Sun Sep 16, 2018 12:06 pm

Another note regarding trim:
You might verify or double check your /etc/fstab having noatime mount options enabled on the ssd-partions.
I do also prefere not to enable continuous trim with mount discard option.
And last but not least, do verify that your ssd does support trim at all by running this command

Code: Select all

lsblk --discard
and check that the "DISC-GRAN" column is non-zero for your ssd-drive.
( fstrim might be smart enough not to harm you ssd, even when the ssd would not support trim. But better check twice ;=)
:fox:
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

User avatar
chrispop99
Forum Guide
Forum Guide
Posts: 2364
Joined: Tue Jan 27, 2009 3:07 pm

Re: ssd trim

#5 Post by chrispop99 » Sun Sep 16, 2018 12:10 pm

fehlix wrote:
Sun Sep 16, 2018 12:06 pm
fstrim might be smart enough not to harm you ssd, even when the ssd would not support trim. But better check twice
I had some early SSD's that didn't support trim, and if you tried, trim refused to run.

As you say, no harm in checking though.

Chris
Test machines:
32-bit non-PAE - Thinkpad T41, 1.6GHz Pentium M, 1GB RAM.
32-bit PAE - DELL Latitude D610, 1.73GHz Pentium M, 2GB RAM.
64-bit - Lenovo T61, 2GHz Core 2 Duo, 2GB RAM
64-bit - Gigabyte Z77P-D3, Intel i3-3220, GeForce 8400 GS, 4GB PC3-12800.

User avatar
chrispop99
Forum Guide
Forum Guide
Posts: 2364
Joined: Tue Jan 27, 2009 3:07 pm

Re: ssd trim

#6 Post by chrispop99 » Sun Sep 16, 2018 12:19 pm

With regard to noatime, I used to add that to earlier SSD's, but their lifespan is so high now that I don't bother. I don't use swap however, and set swappiness to 1.

Chris
Test machines:
32-bit non-PAE - Thinkpad T41, 1.6GHz Pentium M, 1GB RAM.
32-bit PAE - DELL Latitude D610, 1.73GHz Pentium M, 2GB RAM.
64-bit - Lenovo T61, 2GHz Core 2 Duo, 2GB RAM
64-bit - Gigabyte Z77P-D3, Intel i3-3220, GeForce 8400 GS, 4GB PC3-12800.

old_guy
Forum Novice
Forum  Novice
Posts: 36
Joined: Sat Oct 28, 2017 4:30 pm

Re: ssd trim

#7 Post by old_guy » Sun Sep 16, 2018 1:31 pm

Thanks All

I'm checking all the suggestions and will accept any more. Looking online much info is more than a few years old. What I got was a Samsung 860 EVO 500GB. I partitioned it to hold several OS's and have a 4TB HD for data. Still sorting things out.

I won't close this out just now. See if any more tips come in.

Earl

User avatar
fehlix
Forum Guide
Forum Guide
Posts: 1423
Joined: Wed Apr 11, 2018 5:09 pm

Re: ssd trim

#8 Post by fehlix » Sun Sep 16, 2018 1:48 pm

old_guy wrote:
Sun Sep 16, 2018 1:31 pm
I'm checking all the suggestions and will accept any more. Looking online much info is more than a few years old. What I got was a Samsung 860 EVO 500GB. I partitioned it to hold several OS's and have a 4TB HD for data. Still sorting things out.
Despite Samsung promising longlive time and having pre-reserved internal "overprovisioning" spare/free unused areas,
I would still leave about 5 -10 GB space of the drive empty (unassigned), e.g. at the "end" of the drive.
Simply as the technique to free up "marked-as-free" blocks is still the same. And you do good for the ssd if it does have for it's internal re-shuffling of blocks during freeing-up enough unused space, otherwise it needs to rewrite/reshuffel used blocks,
which increases unneeded internal write operations.
Similar strategy with "noatime": It avoids unnecessary write operations onto the file-systems, i.e. on the ssd.
Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB

User avatar
chrispop99
Forum Guide
Forum Guide
Posts: 2364
Joined: Tue Jan 27, 2009 3:07 pm

Re: ssd trim

#9 Post by chrispop99 » Sun Sep 16, 2018 4:12 pm

Since kernel 2.6.30 the default state is relatime. This reduces writes significantly whilst still providing a degree of time-stamping.

Even without noatime, the likely life of a modern SSD is much longer than the hardware around it, and significanly longer than a spinner.

Chris
Test machines:
32-bit non-PAE - Thinkpad T41, 1.6GHz Pentium M, 1GB RAM.
32-bit PAE - DELL Latitude D610, 1.73GHz Pentium M, 2GB RAM.
64-bit - Lenovo T61, 2GHz Core 2 Duo, 2GB RAM
64-bit - Gigabyte Z77P-D3, Intel i3-3220, GeForce 8400 GS, 4GB PC3-12800.

sunrat
Forum Regular
Forum Regular
Posts: 200
Joined: Mon Mar 28, 2016 9:54 pm

Re: ssd trim

#10 Post by sunrat » Sun Sep 16, 2018 8:08 pm

I have never needed to check atime on my personal computer so always set noatime anyway. Modification times are still written whenever a file changes.
Weekly fstrim is the main thing for SSD optimisation.

Post Reply

Return to “MX Help”