SSD Disks.jpg

It is well-known that the low-level operation of solid-state drives (SSD) differs a lot from that of HDDs.

If the file system supports it, it can be beneficial to tell the SSD from time to time which blocks of data are no longer in use (deleted files, etc.). At least, this allows to avoid the performance degradation.

TRIM operation is provided exactly for that purpose and it can be used with the most of the modern SSDs. The file systems commonly used in Linux, like ext4, btrfs, xfs and some others, already support TRIM.

There are two main ways to get TRIM done:

Ubuntu chose the second way starting from version 14.04. Now we have it in ROSA Fresh R4 too — just install ssd-utils package and that is it.

ssd-utils will perform fstrim right after the installation (for the file systems that support it) and will arrange for fstrim to run once a week automatically.

It is worth mentioning that the systems with encrypted volumes, RAID, devmapper-based volumes and the like may require some manual steps to make sure TRIM requests from the file system actually get to the underlying SSD.

Besides, similar to what Ubuntu does, fstrim will run only on the SSDs by the «reliable» vendors by default. At the moment, these vendors are:

There were problems with SSDs by some other vendors that caused file system corruption. Still, if you have an SSD by a vendor not listed above and believe the SSD is OK, you can enable fstrim for it too. To do that, just add --no-model-check option to fstrim-all in /etc/cron.weekly/fstrim.cron (see the comments in that file for details).