SSD noatime mount



  • So my CF card broke and I got a cheap Sandisk SSD instead. I used the full 2.1.3 install, turned on AHCI, TRIM support and RAM disks for /tmp and /var. After a few weeks I noticed that the SSD had written nearly 40GB already, which is odd as I only upgraded to 2.1.4 after install. I suspected vnstat2, it has a cron job that writes every minute, so I set it to every hour using the cron package. I did also install freeradius2 and zabbix2-agent when setting the new box up, but it didn't seem that they were writing too much.
    The Total_LBAs_Written counter didn't stop increasing every minute though.
    So I dug around the net a little and maybe came up with a solution that could help other SSD users and should not harm anything (please correct me if I'm wrong).

    As soon as I mounted my root partition with "noatime" the counter stopped increasing.


  • Rebel Alliance Developer Netgate

    We mount the slices on NanoBSD with noatime, but not on a full install, though it's a good idea to save on writes. On a full install you'll also have continuous writes to the HDD for log files and RRD files.



  • Umm - how do I change the SSD mount to use "noatime"?  I'd like to do the same.  Thx.


  • Netgate Administrator

    On a full install? Edit /etc/fstab. Add the 'noatime' switches to the mounted filesystems.

    Steve



  • @dstroot:

    Umm - how do I change the SSD mount to use "noatime"?  I'd like to do the same.  Thx.

    You may want to also read these articles, they contain additional useful information.
    http://tldp.org/LDP/solrhe/Securing-Optimizing-Linux-RH-Edition-v1.3/chap6sec73.html
    http://lonesysadmin.net/2013/12/08/gain-30-linux-disk-performance-noatime-nodiratime-relatime/

    nodiratime and relatime might be more suitable depending on the programs that you are running and their expectations from the file system.

    On almost all my machines I use these instructions to improve hard disk performance (in most instances more than 10%) or premature wear and tear.

    Halea



  • @jimp:

    We mount the slices on NanoBSD with noatime, but not on a full install, though it's a good idea to save on writes. On a full install you'll also have continuous writes to the HDD for log files and RRD files.

    Jim, (et al)
    Is there a page/document that explains the implementation differences between the nano version and the regular version to discover maybe more good tricks about how to better handle flash disks or SSDs?
    Also, are the packages different when you install them from within pfsense with the package manager whether you are running the nano version or the regular? I am curious to know if those packages are equally optimized for reduced storage access.
    Thanks.
    Halea



  • @haleakalas:

    nodiratime and relatime might be more suitable depending on the programs that you are running and their expectations from the file system.

    These are linux specific, not available in FreeBSD AFAIK.


  • Rebel Alliance Developer Netgate

    @haleakalas:

    Is there a page/document that explains the implementation differences between the nano version and the regular version to discover maybe more good tricks about how to better handle flash disks or SSDs?
    Also, are the packages different when you install them from within pfsense with the package manager whether you are running the nano version or the regular? I am curious to know if those packages are equally optimized for reduced storage access.

    https://doc.pfsense.org/index.php/Full_Install_and_NanoBSD_Comparison



  • Thanks Jim. That's what I was looking for.
    Thanks Charlie for the correction. My mind was elsewhere thinking about SSD optimization rather than pfSense and FreeBSD. To tell you the truth I didn't even know that they were not available in FreeBSD, it's good to know. We have been dealing with another batch of zapped SSD drives lately after less than a couple of years of field use and when we tried to get to the bottom of the problem this was one route that we investigated. Anyway… Thanks for the correction and info.
    Halea