Forums

Adam
Adam
Offline
Resolved
0 votes
If I installed ClearOS on an SSD drive, is Trim supported? Would I have to manually configure anything?
Tuesday, February 13 2018, 11:58 AM
Share this post:
Responses (7)
  • Accepted Answer

    Tuesday, February 13 2018, 03:52 PM - #Permalink
    Resolved
    0 votes
    Decided to gamble initially with 2 SSD drives :-) and delighted later as this experiment progressed...
    https://techreport.com/review/24841/introducing-the-ssd-endurance-experiment
    https://techreport.com/review/27436/the-ssd-endurance-experiment-two-freaking-petabytes
    https://techreport.com/review/27909/the-ssd-endurance-experiment-theyre-all-dead

    The two oldest drives are now both about 4.75 years old and have been running 24x7 throughout that time - with 30.6 TB writes on one and 59.2 TB for the other. The manufacturers rating is 22TB - these are living on borrowed time :-) One similar to mine in the referenced experiment lasted for 750TB before it died. If mine are only half as good will still be very happy..
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, February 13 2018, 02:47 PM - #Permalink
    Resolved
    0 votes
    As you may have guessed, I don't have an SSD yet.

    WRT lots of writes, years ago I researched caching syslog writes in memory and writing them in batch, but when I wanted the references again I could not find them. I think I've looked for the same sort of thing with rsyslog but not found anything.
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, February 13 2018, 01:52 PM - #Permalink
    Resolved
    0 votes
    Well I could be wrong :-) My understanding for ext4 and xfs is that fstrim is built into the mkfs option by default - but not the mount... but could have a faulty flipped bit in my memory... Also if you are using LVM and/or raid and/or encryption than all the layers in use must also support fstrim.
    Use of immediate 'discard' by adding it to the mount options can cause performance problems under certain conditions. That's why the weekly fstrim option was enabled here...

    One thing to be aware of is writes to the SSD. On my main server 'danda' the writes per day exceeded the manufacturer's specification (Samsung SSD 840 PRO) even though the "noatime' option was used in fstab. Within a few days my new drive was no longer covered by warranty :-( The 'Smart' data tracks hours and writes - so its easy for the manufacturer to determine use for a returned drive...

    This smart data can be tracked - for example look for the SSD graphs on this page http://www.sraellis.tk/frame.php?number=26&monitor=ssd_write - you will see other SSD stats by looking in the left-hand frame, or by selecting home and other systems with an SSD..
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, February 13 2018, 01:23 PM - #Permalink
    Resolved
    0 votes
    Thanks, Tony. I was just remembering info I'd seen on the kernels a long while ago. Obviously my memory is faulty. I would need to research the fstab "discard" option to see if that was viable.

    As I am lazy, I favour the use of the cron.daily, cron.weekly and cron.monthly folders so I'd just dump your script into one of those.
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, February 13 2018, 01:11 PM - #Permalink
    Resolved
    0 votes
    Nick - this is the default on all my ClearOS 7.x installations

    [root@alice ~]# systemctl status fstrim.service
    ● fstrim.service - Discard unused blocks
    Loaded: loaded (/usr/lib/systemd/system/fstrim.service; static; vendor preset: disabled)
    Active: inactive (dead)
    [root@alice ~]#

    As a minimum that would need to be enabled - or are you referring to something else?
    On ClearOS 6.x

    [root@danda ~]# cat /etc/clearos-release
    ClearOS Community release 6.9.0 (Final)
    [root@danda ~]# rpm -q --whatprovides /sbin/fstrim
    util-linux-ng-2.17.2-12.28.el6_9.2.x86_64
    [root@danda ~]#

    and it was on 6.x the batch file was created - and just continued its use on 7.x
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, February 13 2018, 01:02 PM - #Permalink
    Resolved
    0 votes
    Not enabled by default - there is much information on the web - just two hits out of many...

    https://johnsontravis.wordpress.com/2016/04/24/tutorial-4-ssd-trim-on-centos-7/
    https://jkraemer.net/2015/06/the-effect-of-trim-on-my-2-year-old-samsung-ssd-840-pro

    Periodic trim rather than immediate is normally preferred. Ensure your SSD supports trim - some older ones don't... check the manufacturers specs. As neither LVM nor encryption is used here - it's simple... As have a mixture of ClearOS 6.x and 7.x machines with SSDs - opted for weekly trim using the same batch job for all...

    cron entry

    03 06 * * 7 /usr/local/bin/fstrim.sh

    The batch file - requires mail to be set-up to receive the report, and only SSDs at /dev/sda on the machines here...
    [[ and change the email address if you use this as a template :-) ]]

    [root@karien ~]# cat /usr/local/bin/fstrim.sh
    #!/bin/sh

    # /usr/local/bin/fstrim.sh for ClearOS 6.x and 7.x
    # Run fstrim on a SSD and format the reported bytes in human readable format
    # Version 1.0 created 22 June 2014 by Tony G Ellis


    /usr/sbin/fstrim -v / > /tmp/fstrim.message.txt # change to /sbin/fstrim for ClearOS 6.x

    MBytes_trimmed=`cat /tmp/fstrim.message.txt | awk '{print int($2/(1024*1024)) }'`
    MBytes_trimmed=`/usr/bin/printf "%'d" $MBytes_trimmed`
    Today=" on "`date +%F`

    Email_body=$MBytes_trimmed" MBytes were trimmed "$Today" for disk /dev/sda installed at "$HOSTNAME
    echo $Email_body | mail -s "fstrim results for SHOSTNAME" admin@sraellis.no-ip.com

    rm /tmp/fstrim.message.txt
    exit

    Typical mail

    From root <root@sraellis.com>
    Subject fstrim results for danda.sraellis.com
    To Me <admin@sraellis.no-ip.com>

    803 MBytes were trimmed on 2018-02-13 for disk /dev/sda installed at danda.sraellis.com
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, February 13 2018, 12:26 PM - #Permalink
    Resolved
    0 votes
    I believe support is built into ClearOS 7 but not ClearOS 6. You do not have to do anything to configure it.
    The reply is currently minimized Show
Your Reply