Welcome!
Important information-- Information on torrent hosting changes
-- Information on MX15/16 GPG Keys
-- Spectre and Meltdown vulnerabilities
News
-- MX Linux on social media: here
-- Mepis support still here
Current releases
-- MX-18.1 Point Release release info here
-- Migration Information to MX-18 here
-- antiX-17.3.1 release info here
New users[/u
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules
ssd trim <Answered>
ssd trim <Answered>
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
Earl
Last edited by old_guy on Tue Sep 18, 2018 12:43 pm, edited 1 time in total.
Re: ssd trim
Cron.weekly might be smart enough to run when it's over due.old_guy wrote: ↑Sun Sep 16, 2018 11:29 amI 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
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
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB
- chrispop99
- Forum Guide
- Posts: 2629
- Joined: Tue Jan 27, 2009 3:07 pm
Re: ssd trim
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:
Chris
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
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.
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.
Re: ssd trim
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
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 ;=)

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
( fstrim might be smart enough not to harm you ssd, even when the ssd would not support trim. But better check twice ;=)

Gigabyte Z77M-D3H, Intel Xeon E3-1240 V2 (Quad core), 32GB RAM,
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB
- chrispop99
- Forum Guide
- Posts: 2629
- Joined: Tue Jan 27, 2009 3:07 pm
Re: ssd trim
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.
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.
- chrispop99
- Forum Guide
- Posts: 2629
- Joined: Tue Jan 27, 2009 3:07 pm
Re: ssd trim
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
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.
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.
Re: ssd trim
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
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
Re: ssd trim
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
GeForce GTX 770, Samsung SSD 850 EVO 500GB, Seagate Barracuda 4TB
- chrispop99
- Forum Guide
- Posts: 2629
- Joined: Tue Jan 27, 2009 3:07 pm
Re: ssd trim
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
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.
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.
Re: ssd trim
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.
Weekly fstrim is the main thing for SSD optimisation.