Although some new SSDs are capable of TRIMming themselves for the ones that can’t you can enable the ‘discard’ option in the kernel for the SSDs in the system. This will do two things:
– Enable a regular TRIMming of the SSD for each mountpoint you enabled in the /etc/fstab
– Allow to run manually the ‘fstrim’ command to force an immediate TRIM of the mounted partition.
Edit /etc/fstab and ad the option ‘discard’ for each mountpoint in which the partition involved is located on an SSD drive: eg.
UUID=60662e55-26b9-45ab-9ca1-8ab6cc0404cb / ext3 errors=remount-ro,discard 0 1
To run/force the TRIM manually: For example for the root partition:
fstrim -v /
For forcing TRIM in all the ‘Trimmable’ partitions:
fstrim -v -a
NOTE: If you installed a SAMSUNG SSD make sure you read this article(especially at the end) before you enable the ‘discard’ in the /etc/fstab.