Automatic TRIM vs. manual TRIM

Posted by Eike Cochu on Ask Ubuntu See other posts from Ask Ubuntu or by Eike Cochu
Published on 2012-10-24T19:52:29Z Indexed on 2012/10/25 5:21 UTC
Read the original article Hit count: 328

Filed under:
|

I am currently trying to find out how to trim with my new TP and was wondering about the difference of manual/online trimming.

Here is my setup:

ThinkPad T430s with SSD Samsung 830, 128GB and Xubuntu 12.10, here are some outputs to check if trim will work on my system (got these from here: http://wiki.ubuntuusers.de/SSD/TRIM)

root@eike-tp:~# sudo hdparm -I /dev/sda | grep -i TRIM
   *    Data Set Management TRIM supported (limit 8 blocks)

First, I tried the online trimming: How to enable TRIM?

my fstab with discard inserted:

UUID=d6c49c17-a4f1-466c-9f7e-896c20db3bba /  ext4  discard,noatime,errors=remount-ro  0  1
# swap was on /dev/sda5 during installation
UUID=a0322f5f-c6c1-4896-863f-668f0638d8cf none  swap  sw  0   0
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0

I tried to test if it works (but I don't get any zeroes when I try it with /dev/sda), but found out that this method is only possible with SSD type 2 and I seem to have type 3. So I don't know if it works or not.

The Ubuntuwiki (first link) recommends manual trimming, so I set up a daily cronjob instead of discard:

#!/bin/sh
LOG=/var/log/batched_discard.log
echo "*** $(date -R) ***" >> $LOG
fstrim -v / >> $LOG

the wiki article suggests weekly or daily. Now to my questions:

How often executes the automated trim? How often is recommended? Online vs. manual trimming?

Thank you for your help

© Ask Ubuntu or respective owner

Related posts about ssd

Related posts about trim