6

I read that Linux doesn't issue automatic TRIM commands (the discard mount option), due to performance problems. I've added fstrim -a in my crontab to TRIM once a week.

Does issuing fstrim too often reduce the lifespan of the drive ? Are TRIM commands equivalents to write operations ? Or can I run fstrim more often, as once a day ?

1
  • 1
    The whole point to TRIM is to extend the life of the drive, I dont see any reason to not run it every day. In windows 7 it uses the trim command every time you delete or move a file...en.wikipedia.org/wiki/Trim_(computing)#Operation
    – Moab
    Apr 10, 2016 at 18:08

2 Answers 2

6

No (most likely), the TRIM command simply tells the SSD that you're no longer using this file. What the SSD does with that information is up to the SSD, which is why I included the "most likely." The point of TRIM is to improve write performance. How does it improve write performance? By letting the SSD know you're no longer using particular files, the SSD don't have to waste time copying those files to a new location when it needs to free up space. In other words, you're improving write performance by eliminating unnecessary internal write operations. Doesn't this also extend the life of the drive? Yes it does, but most SSD have internal wear leveling features that is responsible for the bulk of "life extending" aspect. Use TRIM as much as you like. If the SSD is good, you will get both performance, and longer life.

1

No

TRIM is a hint to the drive that the specified blocks are no longer in use and are safe to erase. The drive is not required to erase those blocks immediately and in fact is allowed to ignore the hint altogether. Hence, sending lots of TRIM commands should not reduce the life of any SSD that has reasonably well-designed garbage-collection algorithms.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.