SSD optimization for Linux

Discussion in 'all things UNIX' started by moontan, Jan 12, 2013.

Thread Status:
Not open for further replies.
  1. moontan

    moontan Registered Member

    Joined:
    Sep 11, 2010
    Posts:
    3,931
    Location:
    Québec
    i bought recently an Adata SP900 Prenier Pro SSD.

    it does not seem like Linux has an easy way to optimize a SSD like in Win 8.

    is this something i should be concerned about?
    i'm kinda worried i might shorten the lifespan of my SSD.

    what do you folks think about this?

    here's a link to an Arch Wiki about this subject:
    https://wiki.archlinux.org/index.php/Solid_State_Drives
     
  2. tlu

    tlu Guest

    I don't think that SSD optimization on Linux is very difficult.

    - Proper alignment using MebiByte (MiB) bounderies is done since Ubuntu Maverick and also by newer versions of gparted and fdisk. So nothing to worry about.

    - Scheduler: That article you're pointing to says that it is recommended to switch from cfq to noob or deadline. However, the Phoronix article mentioned there summarizes:

    Again, nothing to worry about.

    - Mount options: Newer kernels since 2.6.30 use relatime as default (corresponding to what is said in the article).

    - Trim: AFAIK, batched trim should still be preferred. (If the discard option is useful is not clear, IMHO.) I suggest that you add a file like

    Code:
    #!/bin/sh
    
    LOG=/var/log/batched_discard.log
    echo "*** $(date -R) ***" >> $LOG
    /sbin/fstrim / >> $LOG
    /sbin/fstrim /home >> $LOG
    to /etc/cron.weekly (make it executable).
     
    Last edited by a moderator: Jan 12, 2013
  3. moontan

    moontan Registered Member

    Joined:
    Sep 11, 2010
    Posts:
    3,931
    Location:
    Québec
    tnx tlu. :thumb:

    does it matter what name i give it?
     
  4. tlu

    tlu Guest

    You're welcome!

    No ;) I just called it batched_discard. Again, don't forget to make it executable.
     
  5. moontan

    moontan Registered Member

    Joined:
    Sep 11, 2010
    Posts:
    3,931
    Location:
    Québec
  6. shuverisan

    shuverisan Registered Member

    Joined:
    Dec 23, 2011
    Posts:
    185
    Great thread.

    @Moontan
    In the vid you post, guy modifies rc.local to change the IO scheduler, interesting. I've always just added it into Grub, never thought to do it his way.

    Some more reading on fstrim.
    http://en.opensuse.org/SDB:SSD_discard_(trim)_support

    I've never seen a Ubuntu or Debian distro install to an SSD and automatically use discard. It has to be added manually.
     
Loading...
Thread Status:
Not open for further replies.