Status of TRIM on Linux?

VirtualLarry

No Lifer
Aug 25, 2001
56,548
10,171
126
I heard that Linux only enables TRIM on certain whitelisted drives, instead of any drive that reports that it is supported.
 

F1shF4t

Golden Member
Oct 18, 2005
1,583
1
71
I just run fstrim every month, but would be interesting to know for sure.
 

Essence_of_War

Platinum Member
Feb 21, 2013
2,650
4
81
I heard that Linux only enables TRIM on certain whitelisted drives, instead of any drive that reports that it is supported.

On the most recent distros, I think TRIM is enabled by default on drives that support it. You can check your fstab to be sure by running:

Code:
grep discard /etc/fstab

you should see something like:

Code:
/dev/sdaX / ext4 defaults,noatime,[U][B]discard [/B][/U]

for a linux installation with trim enabled. I think you should be able to add the "discard" option manually for any drive that supports TRIM that doesn't have it enabled by default.
 

H54

Member
Jan 16, 2011
187
0
71
There is a fair amount of info on the net that claims adding discard to fstab noticeably affect performance.

If you're using systemd:
Code:
sudo systemctl enable fstrim.timer && sudo systemctl start fstrim.timer

I tested disk performance before and after:
Code:
sudo hdparm -t /dev/sdx
 

H54

Member
Jan 16, 2011
187
0
71
What did you find?


Whoops, somehow the rest of the post was cut off.

I ran several tests before and after the change. Consistently, reads were substantially higher.

Code:
run 1
 Timing buffered disk reads: 1478 MB in  3.00 seconds = 492.20 MB/sec

run 2
 Timing buffered disk reads: 1492 MB in  3.00 seconds = 497.04 MB/sec

run 3
 Timing buffered disk reads: 1496 MB in  3.00 seconds = 498.66 MB/sec

They used to be in the low to mid 400s (420-430, typically).
 

Elixer

Lifer
May 7, 2002
10,371
762
126
I have been doing fstrim -v / monthly on the work laptop, and this time around, it reported back 56GB trimmed.
For a year, the average is around 20GB trimmed.
This SSD has 256GB, haven't seen any slow downs on it, so, I am not even sure it is worth it to add fstrim to a cron job to execute daily/weekly instead of monthly.

I am hesitant to add discard to fstab from all the bad stories about it.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |