Wednesday, September 09, 2015

SSD trim


This article explains what is TRIM and how to handle in Windows platform.

Below two related to Ubutu, and I am happy to see there is already weekly job for trimming.


tail -n1 /etc/cron.weekly/fstrim 
/sbin/fstrim --all || true
 
http://askubuntu.com/questions/443761/how-is-trim-enabled

http://askubuntu.com/questions/18903/how-to-enable-trim

 
However, due to my SSD capacity is small (120GB) only, I decided to have a daily cron job instead
 as shown below..


/etc/cron.daily$ cat trimssd
#!/bin/sh
LOG=/var/log/trimssd.log
echo "*** $(date -R) ***" >> $LOG
fstrim -v / >> $LOG


hmc@hmc-P55A-UD3:/etc/cron.daily$ sudo chmod 755 trimssd
hmc@hmc-P55A-UD3:/etc/cron.daily$ sudo ./trimssd
hmc@hmc-P55A-UD3:/etc/cron.daily$ cat /var/log/trimssd.log
*** Wed, 09 Sep 2015 23:11:59 +0800 ***
/: 3.3 GiB (3499556864 bytes) trimmed