The One with the Thoughts of Frans

SSD Optimizations

As I wrote yesterday, I migrated my Linux install from an HDD to an SSD. That runs great by default, but you should add the discard argument to the relevant entries in /etc/fstab to enable TRIM support. Long-time SSD performance should remain great thanks to that simple action, which in my case looks like this:

# /dev/sda1
UUID=b8024bbf-9d29-417d-b6eb-ef87d0d586ec /               ext4    errors=remount-ro,discard 0       1
# /dev/sda2
UUID=30efde45-b883-464d-966c-605e091078b9 /home           ext4    defaults,user_xattr,discard        0       2

Some also recommend to set noatime to prolong your drive’s life, but since relatime is the default these days that doesn’t seem necessary to me. However, what you should probably do if you’ve got a sufficient amount of RAM, is to mount /tmp in it.

tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
tmpfs /var/tmp tmpfs defaults,noatime,mode=1777 0 0

You can do the same thing with your logs, but I’m not too sure whether I want to do that myself, even if it would cut down on writes.

1 Comment

  1. On my new Wheezy install, I switched to a daily cron job for better performance.

    # Don't forget to chmod +x /etc/cron.daily/trim
    echo "*** $(date -R) ***" >> $LOG
    fstrim -v / >> $LOG
    fstrim -v /home >> $LOG

    Thanks to

    July 5, 2013 @ 19:48Permalink

RSS feed for comments on this post· TrackBack URI

Leave a Comment

You must be logged in to post a comment.