Trim - while there are command line versions - is really more of a moun-time option than a command, or at least that is the smartest way to use it.
Here is my laymans explanation of why it is necessary.
The need for trim originated because of the way traditional hard drives delete files. They simply remove the reference to them from the file allocation table, rather than physically erasing the space they occupy. This works well for traditional hard drives as there is no performance penalty for overwriting something. With flash ram there IS adeletion and overwriting penalty. In the days before trim (or without trim enabled) users of SSD's would notice that their drives had really fast write speeds, up until they had filled every block on the drive once (so essentially, if you had a 128GB drive, once your total writes had reached 128Gb) after that the drives write performance would slow down A LOT as the flash drive was needing to erase cells before writing to them.
TRIM adds this erase cycle to the file deletion process. During drive idle times shortly after the deletion, it goes in and erases the flash, so that when it is time to write to it again, writes are fast.
There is a way to enable trim in /etc/fstab if using ext4, and it works really well, but it is not fresh in my mind right now. If you just google it, you'll find many examples.
For further reading I recommend this Anandtech article. He has done more to make complex SSD technical issues understandable to laymen like me than anyone else.
--Matt
Bookmarks