[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to enable trim for an external encrypted SSD?

On Tue, Nov 07, 2017 at 01:00:54AM +0500, Alexander V. Makartsev wrote:
Now I wonder, why would anyone want to use TRIM feature on a portable SSD,
especially on an encrypted one?
Isn't this feature only increases drive wear, offering next to nothing as a
benefit in return?
I don't use TRIM feature on my systems because of that, and hope for a firmware
of modern SSD will manage everything automatically. Am I wrong?

TRIM should reduce, not increase, drive wear. (Since the drive knows that a particular block is unusued, it can write directly instead of having to read and rewrite an entire erase group.) It should also increase performance by increasing the free pool on the drive and reduce the garbage collection pressure. The magnitude of any benefits depends heavily on how the drive is used and how the firmware implements its writing and garbage collection routines.

A possible negative is that some drives have bugs in their TRIM implementation (known bad drives are blacklisted). Also, enabling TRIM at the filesystem level can reduce performance depending on the drive's implementation and the read/write patterns on the filesystem. (Issuing large numbers of small TRIM operations can negatively affect performance.) That disadvantage can be avoided by running fstrim in batch rather than having the filesystem TRIM as files are deleted.

Mike Stone

Reply to: