Results 1 to 10 of 10

Thread: SSD care

  1. #1
    Join Date
    May 2015
    Location
    Italy
    Posts
    285

    Default SSD care

    Hi all,
    I am running OpenSUSE off an SSD (a 120Gb Samsung Evo 840). I have the root on the SSD, while my /home is on a bigger mechanical disk.
    Root is BTRFS while /home is XFS.

    I am trying to understand what are the best policies to follow to take care of my SSD (and keep it running for as long as possible). I read a lot of posts on this forums and here is what I'm coming up with.

    This is what I'm already doing:
    - I scheduled a daily TRIM job that runs the fstrim command

    This is what I'm thinking to do:
    1) I see that BTRFS mount options already include "ssd", but I think it would also be better to change realtime to noatime and add nodiratime
    2) I presently have /tmp on the SSD (it is a subvolume of root); I'm thinking about moving it to another disk
    3) I'm thinking about doing the same with /var/tmp

    What do you think about 1), 2) and 3)? Should I proceed?
    Is there something I should take care of when implementing step 2) and 3)?
    Is there something else you would do to avoid tearing of the SSD?

    Thank you in advance.
    Cris

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    23,339
    Blog Entries
    15

    Default Re: SSD care

    On Sat 26 Dec 2015 12:56:02 AM CST, Cris70 wrote:

    Hi all,
    I am running OpenSUSE off an SSD (a 120Gb Samsung Evo 840). I have the
    root on the SSD, while my /home is on a bigger mechanical disk.
    Root is BTRFS while /home is XFS.

    I am trying to understand what are the best policies to follow to take
    care of my SSD (and keep it running for as long as possible). I read a
    lot of posts on this forums and here is what I'm coming up with.

    This is what I'm already doing:
    - I scheduled a daily TRIM job that runs the fstrim command

    This is what I'm thinking to do:
    1) I see that BTRFS mount options already include "ssd", but I think it
    would also be better to change realtime to noatime and add nodiratime
    2) I presently have /tmp on the SSD (it is a subvolume of root); I'm
    thinking about moving it to another disk
    3) I'm thinking about doing the same with /var/tmp

    What do you think about 1), 2) and 3)? Should I proceed?
    Is there something I should take care of when implementing step 2) and
    3)?
    Is there something else you would do to avoid tearing of the SSD?

    Thank you in advance.
    Cris


    Hi
    You shouldn't need a trim job, this is already taken care of by the
    system (well on Leap anyway) via a softlink in cron.

    Follow the guidelines here esp since you have rotating drive;
    https://en.opensuse.org/SDB:SSD_performance

    Never worried about tmp or anything else, it's a disk it's meant to be
    used.... plus since your running Tumbleweed your writing to the SSD
    will be above an average openSUSE install....

    --
    Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
    SUSE Linux Enterprise Desktop 12 | GNOME 3.10.1 | 3.12.51-52.31-default
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!


  3. #3
    Join Date
    May 2015
    Location
    Italy
    Posts
    285

    Default Re: SSD care

    Thank you malcolmlewis for your reply.

    Quote Originally Posted by malcolmlewis View Post
    Hi
    You shouldn't need a trim job, this is already taken care of by the
    system (well on Leap anyway) via a softlink in cron.
    I only see btrfs scrub and btrfs balance being run here by cron. Nothing regarding trim.

    Quote Originally Posted by malcolmlewis View Post
    Follow the guidelines here esp since you have rotating drive;
    https://en.opensuse.org/SDB:SSD_performance


    Thank you! This is very valuable information. However, the article is quite outdated and most of the things said there are already taken care of by the standard Tumbleweed installation (e.g. I see that tumbleweed automatically selected "deadline" as the scheduler for the SSD).
    This is very good news however.

    Quote Originally Posted by malcolmlewis View Post
    Never worried about tmp or anything else, it's a disk it's meant to be
    used.... plus since your running Tumbleweed your writing to the SSD
    will be above an average openSUSE install....
    Well, that's not what is written on the article that you pointed me to. It explicitly recommends putting temp data on a TMPFS.
    However, that makes me wonder about Tumbleweed's policy about cleaning the /tmp directory. The article says that OpenSUSE will wipe it at every boot, but that's not what I'm seeing. Actually, today I can see files dated 23-11-2015 in my /tmp.
    Do you know how often (if at all) is /tmp supposed to be cleaned on Tumbleweed? I do not find a cron job for that and /etc/tmpfiles.d is empty.

    Thank you in advance.
    Cris
    Last edited by Cris70; 26-Dec-2015 at 04:28. Reason: add more info

  4. #4
    Join Date
    May 2015
    Location
    Italy
    Posts
    285

    Default Re: SSD care

    Replying to myself: there is NO policy for cleaning tmp files on Tumbleweed.

    I see this in /usr/lib/tmpfiles.d/tmp.conf:
    Code:
    ...
    # Clear tmp directories separately, to make them easier to override
    # SUSE policy: we don't clean those directories
    ...
    Cris

  5. #5
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    22,131

    Default Re: SSD care

    To configure clearing /tmp, etc at boot
    Code:
    cp /usr/lib/tmpfiles.d/tmp.conf /etc/tmpfile.d/tmp.conf
    This file will now overrule the original. I have in it
    Code:
    D /tmp 1777 root root 1d
    D /var/tmp 1777 root root 1d
    which will clear /tmp aand /var/tmp.

    See also
    Code:
    man tmpfiles.d
    Henk van Velden

  6. #6
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    23,339
    Blog Entries
    15

    Default Re: SSD care

    Quote Originally Posted by Cris70 View Post
    Thank you malcolmlewis for your reply.



    I only see btrfs scrub and btrfs balance being run here by cron. Nothing regarding trim.



    Thank you! This is very valuable information. However, the article is quite outdated and most of the things said there are already taken care of by the standard Tumbleweed installation (e.g. I see that tumbleweed automatically selected "deadline" as the scheduler for the SSD).
    This is very good news however.



    Well, that's not what is written on the article that you pointed me to. It explicitly recommends putting temp data on a TMPFS.
    However, that makes me wonder about Tumbleweed's policy about cleaning the /tmp directory. The article says that OpenSUSE will wipe it at every boot, but that's not what I'm seeing. Actually, today I can see files dated 23-11-2015 in my /tmp.
    Do you know how often (if at all) is /tmp supposed to be cleaned on Tumbleweed? I do not find a cron job for that and /etc/tmpfiles.d is empty.

    Thank you in advance.
    Cris
    Hi
    On openSUSE Leap 42.1 (MacBook3,1 and OCZ Vertex460A) I see;

    Code:
     ls /etc/cron.weekly/
    btrfs-balance.sh  btrfs-trim.sh
    
    ls /etc/cron.monthly/
    btrfs-scrub.sh
    
    ls -la /etc/cron.weekly/
    total 8
    drwxr-xr-x 1 root root   58 Oct 29 15:35 .
    drwxr-xr-x 1 root root 5100 Dec 26 17:15 ..
    lrwxrwxrwx 1 root root   44 Oct 29 15:35 btrfs-balance.sh -> /usr/share/btrfsmaintenance/btrfs-balance.sh
    lrwxrwxrwx 1 root root   41 Oct 29 15:35 btrfs-trim.sh -> /usr/share/btrfsmaintenance/btrfs-trim.sh
    Maybe it doesn't run with mixed disks? Else create your own softlink as above.

    Yes, the article may be old, but still relevant, also check the SSD manufacturers website and specs for any other tweaks, firmware updates etc.

    Never worried about /tmp so can't comment.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    openSUSE Leap 42.2 (x86_64) GNOME 3.20.2
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  7. #7
    Join Date
    May 2015
    Location
    Italy
    Posts
    285

    Default Re: SSD care

    Hi malcolmlewis!

    Quote Originally Posted by malcolmlewis View Post
    Hi
    On openSUSE Leap 42.1 (MacBook3,1 and OCZ Vertex460A) I see;

    Code:
     ls /etc/cron.weekly/
    btrfs-balance.sh  btrfs-trim.sh
    
    ls /etc/cron.monthly/
    btrfs-scrub.sh
    
    ls -la /etc/cron.weekly/
    total 8
    drwxr-xr-x 1 root root   58 Oct 29 15:35 .
    drwxr-xr-x 1 root root 5100 Dec 26 17:15 ..
    lrwxrwxrwx 1 root root   44 Oct 29 15:35 btrfs-balance.sh -> /usr/share/btrfsmaintenance/btrfs-balance.sh
    lrwxrwxrwx 1 root root   41 Oct 29 15:35 btrfs-trim.sh -> /usr/share/btrfsmaintenance/btrfs-trim.sh
    Maybe it doesn't run with mixed disks? Else create your own softlink as above.
    I don't have that symlink here (btrfs-trim.sh).
    I was about to create it, but then I found a note in /etc/sysconfig/btrfsmaintenance (red and underlined by me):
    Code:
    ## Path:           System/File systems/btrfs
    ## Description:    Configuration for periodic fstrim
    ## Type:           string(none,daily,weekly,monthly)
    ## Default:        "none"
    ## ServiceRestart: btrfsmaintenance-refresh
    #
    # Frequency of periodic trim. Off by default so it does not collide with
    # fstrim.timer . If you do not use the timer, turn it on here. The recommended
    # period is 'weekly'.
    BTRFS_TRIM_PERIOD="none"
    So I did a little research on fstrim.timer. I discovered that, on Tumbleweed, there was a recent (snapshot 20151214) change regarding this:
    Code:
    ==== systemd-presets-branding-openSUSE ====
    
    - Enable fstrim.timer and disable fstrim.service. TRIM should be
      performed once a week and not on every boot (FATE#317727).
      http://www.spinics.net/lists/util-li.../msg09133.html
    So I decided to enable the timer and start it, with the following two commands:
    Code:
    $ systemctl enable fstrim.timer
    $ systemctl start fstrim.timer
    I am reporting this because I think it may be of some help to others, and also to have it documented somewhere.

    Cris

  8. #8
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    23,339
    Blog Entries
    15

    Default Re: SSD care

    Quote Originally Posted by Cris70 View Post
    Hi malcolmlewis!



    I don't have that symlink here (btrfs-trim.sh).
    I was about to create it, but then I found a note in /etc/sysconfig/btrfsmaintenance (red and underlined by me):
    Code:
    ## Path:           System/File systems/btrfs
    ## Description:    Configuration for periodic fstrim
    ## Type:           string(none,daily,weekly,monthly)
    ## Default:        "none"
    ## ServiceRestart: btrfsmaintenance-refresh
    #
    # Frequency of periodic trim. Off by default so it does not collide with
    # fstrim.timer . If you do not use the timer, turn it on here. The recommended
    # period is 'weekly'.
    BTRFS_TRIM_PERIOD="none"
    So I did a little research on fstrim.timer. I discovered that, on Tumbleweed, there was a recent (snapshot 20151214) change regarding this:
    Code:
    ==== systemd-presets-branding-openSUSE ====
    
    - Enable fstrim.timer and disable fstrim.service. TRIM should be
      performed once a week and not on every boot (FATE#317727).
      http://www.spinics.net/lists/util-li.../msg09133.html
    So I decided to enable the timer and start it, with the following two commands:
    Code:
    $ systemctl enable fstrim.timer
    $ systemctl start fstrim.timer
    I am reporting this because I think it may be of some help to others, and also to have it documented somewhere.

    Cris
    Hi
    Well spotted! The differences between Leap and Tumbleweed

    Add it to the SDB article which you should be able to edit...
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    openSUSE Leap 42.2 (x86_64) GNOME 3.20.2
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  9. #9
    Join Date
    May 2015
    Location
    Italy
    Posts
    285

    Default Re: SSD care

    Hi malcolmlewis!

    Quote Originally Posted by malcolmlewis View Post
    Hi
    Well spotted! The differences between Leap and Tumbleweed

    Add it to the SDB article which you should be able to edit...
    Which one should I modify? This one or this one?

    I can modify them, but they're both outdated: they don't deal with Leap nor Tumbleweed. The most recent openSUSE release to be dealt with is 11.4.
    I'm not sure how I should proceed.

    Cris
    Desktop: OpenSUSE Tumbleweed (x86_64) - AMD FX-8350 Eight-Core Processor, 8Gb RAM, 120GB Samsung Evo 840 SSD
    Laptop: OpenSUSE Tumbleweed (x86_64) - Thinkpad T440 - Intel i5-4210U, 12Gb RAM, 250GB Samsung EVO 750 SSD

  10. #10
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    23,339
    Blog Entries
    15

    Default Re: SSD care

    Hi
    This one;
    https://en.opensuse.org/SDB:SSD%20performance

    You can add a Tumbleweed entry in the list at the beginning.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    openSUSE Leap 42.2 (x86_64) GNOME 3.20.2
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •