Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
21
rated 0 times [  21] [ 0]  / answers: 1 / hits: 14813  / 1 Year ago, wed, march 22, 2023, 5:09:24

I read in one of the webupd8 articles that TRIM support, which was introduced in Ubuntu 14.04, by default only works for Intel and Samsung SSDs. What about other? I am using Dell XPS 13 Dev Edition laptop and the SSD is from a different manufacturer, so does TRIM work by default as well or I have to manually make a cron job file?


More From » ssd

 Answers
6

Everything is already installed.



The command to activate trim 1 time:



sudo fstrim -v /


It will take a while and then show the results. Example:



sudo fstrim -v /
[sudo] password for rinzwind:
/: 93184647168 bytes were trimmed


And it is set up by default to run once a week for -supported devices-:



$ locate fstrim
/etc/cron.weekly/fstrim
/sbin/fstrim


If you check the cron job it is all explained:



$ more /etc/cron.weekly/fstrim 
#!/bin/sh
# call fstrim-all to trim all mounted file systems which support it
set -e

# This only runs on Intel and Samsung SSDs by default, as some SSDs with faulty
# firmware may encounter data loss problems when running fstrim under high I/O
# load (e. g. https://launchpad.net/bugs/1259829). You can append the
# --no-model-check option here to disable the vendor check and run fstrim on
# all SSD drives.
exec fstrim-all


If the manual method works, you can add --no-model-check to the command at the end (exec fstrim-all) for it to activate.






The link in the file is an interesting read. It also has a method to check if your disc is bugged. A lot of the cheaper SSDs are faulty and could destroy data.






And to top it off: this is a list of compatible hardware (PDF download) including SSDs.






There is another method where you add discard to your fstab for permanent trimming. Benchmarks (German) favor fstrim over discard.


[#25978] Friday, March 24, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
suitman

Total Points: 487
Total Questions: 105
Total Answers: 98

Location: India
Member since Wed, Aug 4, 2021
3 Years ago
;