Post date: 18-Oct-2010 05:11:13
A new method to do scheduled TRIM has been established to be better than sending TRIM commands on every delete. The method is described under the Scheduled TRIM section here.
discard
option to turn TRIM on as described below. TRIM and the SSD's controller should be enough to keep it in good shape in terms of speed and longevity. I personally use an OCZ Agility 2 60GB with discard
only and as you can see the average read speed is still well sustained at ~250MB/s after around a bit over month of use (image to the right).Most current SSDs support the ATA_TRIM command for sustained long-term performance and wear-leveling. On Linux TRIM is supported by the Ext4 and Btrfs filesystems but the latter is out of the scope of this tutorial. We need two things in order to enable TRIM:
gedit
for our editing purposes, but if you have another tool on your machine - you are free to use that instead.Having met the two requirements, all we need to do to enable TRIM is the following:
/etc/fstab
for disaster recovery purposes:sudo cp /etc/fstab /etc/fstab_bak-notrim
/etc/fstab
file:gksudo gedit /etc/fstab
discard
to the list of options. That is we prepend or append the word discard
to the existing list of words separating it with comma without leaving space. We do not change anything else. So for example if we have only one partition mounted at root "/":UUID=[NUMS-AND-LETTERS] / ext4 errors=remount-ro 0 1
UUID=[NUMS-AND-LETTERS] / ext4 discard,errors=remount-ro 0 1
[MOUNT-POINT]/etc/fstab
with the backed up one - [MOUNT-POINT]/etc/fstab_bak-notrim
.That's it. Now we should have working TRIM. If we wish to test that it works we can follow this HOWTO.
This is a benchmark of OCZ Agility 60GB SSD used in a laptop on day-to-day basis for a month:
This is a benchmark of OCZ Agility 60GB SSD used in a laptop on day-to-day basis for 3 months:
As you can see the read performance after 3 months of use is well sustained as well as the access time is still just 0.2ms. This is after the drive was filled above 90% several times with virtual machines. The drive seems to successfully recover its performance after files are deleted which means TRIM works as intended.