Solved How Often Do You Trim Your SSD ?

Solved issue

bob466

Well-Known Member
Joined
Oct 22, 2020
Messages
1,868
Reaction score
1,483
Credits
13,549
My internal 500GB SSD is set to run Trim daily but is this enough...I don't think so.
If we don’t perform TRIM regularly we won't be able to reclaim used space on the Drive over time which means the SSD will slow down and die. So I conducted a little experiment running this command manually over several days.
Code:
  sudo fstrim -av

Day 1 Haven't run Trim for a few days manually.
1713662003955.png


Day 2
1713662312053.png


Today...
1713662431224.png

Of cause it depends what I do on the computer.

Above shows the amount of freed space...we can also use this command...
Code:
sudo fstrim / -v

The above command Trims External SSDs...as shown...
1713663816294.png


Either command won't do both...as shown below...
1713664101417.png


I now realise how important Trim is and how much space in frees up. Some people complain their SSD if full and they don't know why...maybe this has something to do with it...I could be wrong.
1713664708976.gif
 


Trim!​

LOL nobody told me about trim is it like defrag?
 
Maybe this is a dumb question, but I know next to nothing about SSD's.
Does this only work with SSD's or is it good for HDD's also?
 
It can be used with internal HDDs, I haven't got it to work on my external HDD.

EDIT - My bad here, I thought I had run it successfully on an internal SATA HDD but apparently not. Wiz
 
Last edited:
Last edited:
It can be used with internal HDDs, I haven't got it to work on my external HDD.

I didn't know this till just now...yes you can Trim an external HDD...I just did but don't need too.
1713677003401.png

The top one is my portable 2TB HDD...the bottom one is my internal 500GB SSD.
m1213.gif
 
Every time I do a clean install I always optimise my SSD to run more efficiently and one of those things is to set Trim to run daily as shown here...
1713677999924.png

I always thought that would be enough but it seems it's not...I may be wrong.
1713678284808.gif
 
on Mint I trim everyday by follow this tip.
On fedora you have to change the
/etc/systemd/system/timers.target.wants/fstrim.timer file
find the Line
Code:
OnCalendar=weekly and change it to
OnCalendar=daily

Note: most distros are set up to do trim weekly , but that maybe too long a time between events as you can loose a lot of space in a week. so I prefer the daily method.
 
Last edited:
on Mint I trim everyday by follow this tip.

On fedora you have to change the

find the Line
Code:
OnCalendar=weekly and change it to
OnCalendar=daily

Note: most distros are set up to do trim weekly , but that maybe too long a time between events as you can loose a lot of space in a week. so I prefer the daily method.

This is exactly what I've been doing from there with a clean install for 5 years but now I don't think it's enough. I don't think it's going to hurt running the Trim command manually more often and now with my External SSDs plugged in too.
m1212.gif
 
I don't think it's going to hurt running the Trim command manually more often
It might. :confused:

From the man page, given above by @GatorsFan...
Running fstrim frequently, or even using mount -o discard, might
negatively affect the lifetime of poor-quality SSD devices. For
most desktop and server systems a sufficient trimming frequency
is once a week. Note that not all devices support a queued trim,
so each trim command incurs a performance penalty on whatever
else might be trying to use the disk at the time.

@kc1di's link says Ubuntu and Mint automatically trim once/week (meeting the man page recommendation)... though the author there suggests daily trim instead. The main thing seems to be to trim regularly. A week's worth of cruft is probably not too much to bear. Plus, if you ever needed to recover deleted files, like with testdisk or photorec, those can't recover deleted files that have been trimmed away. Just something to consider.

Cheers
 
I'm not an expert, but I can't see any advantage to more frequent trimming than daily. But like I said, "I'm no expert."
 
the important thing is to provision 10-20% of SSD to not get used. That will extend its lifetime.
 
I have it set to to the default which is as often as I trim my nails, once every week.
 
It might. :confused:

Quote
"Running fstrim frequently, or even using mount -o discard, might
negatively affect the lifetime of poor-quality SSD devices."


If you use poor quality SSDs (cheap) anything could happen and does...I don't use cheap and small SSDs...as they say...you get what you pay for. Cheap SSDs don't give you a 5 year warranty either...my main SSD is a 500GB Samsung which is nearly 5 yrs old and runs Trim daily.
m1212.gif


Of course nothing is without risks as seen here...
https://ssdsphere.com/trim/ but I think the benefits outweigh the risks.
m1213.gif
 
the important thing is to provision 10-20% of SSD to not get used. That will extend its lifetime.

Could you cite a reference or two for that please?

TIA

Wizard
 
SSD over-provisioning has been a thing for a while:


Overprovisioning, in a storage context, is the inclusion of extra storage capacity in a solid-state drive. SSD overprovisioning can increase the endurance of a solid-state drive by distributing the total number of writes and erases across a larger population of NAND flash memory blocks and pages over time.


SSD overprovisioning also gives the flash controller additional buffer space for managing program/erase cycles (P/E cycles). The additional buffer space improves overall SSD performance. It's particularly useful for improving write performance because it increases the probability that a write operation will have immediate access to a pre-erased block. The reserved SSD capacity is not visible to the host as available storage space.



In practice, an SSD’s performance begins to decline after it reaches about 50% full. This is why some manufacturers reduce the amount of capacity available to the user and set it aside as additional over-provisioning. For example, a manufacturer might reserve 28 out of 128GB and market the resulting configuration as a 100GB SSD with 28% over-provisioning. In actuality, this 28% is in addition to the built-in 7.37%, so it’s good to be aware of how vendors toss these terms around. Users should also consider that an SSD in service is rarely completely full. SSDs take advantage of this unused capacity, dynamically using it as additional over-provisioning.
 
Thank you.
 
@bob466
Very good thread! without you I would probably completely forgot to trim my SSD!
Output below shows 345GB was trimmed but my SSD is 500GB lol

Bash:
sudo fstrim -av

/boot/efi: 505 MiB (529530880 bytes) trimmed on /dev/sdb1
/boot: 277,1 MiB (290580480 bytes) trimmed on /dev/sdb2
/: 345,2 GiB (370706583552 bytes) trimmed on /dev/mapper/msi--vg-root

@etcetera
Anyone one knows how can we tell how much of SSD space is provisioned by manufacturer if any?
 

Members online


Latest posts

Top