Page 1 of 5 123 ... LastLast
Results 1 to 10 of 41

Thread: SSD settings: noatime/trim and btrfs ssd argument

  1. #1

    Question SSD settings: noatime/trim and btrfs ssd argument

    Greetings!

    I have Leap 42.3 which was originally 42.1 and upgraded over the years. It was also originally installed on hdd on single btrfs partition. I did split it into two - /home went to a brand new mechanical hard drive and everything else, on a single btrfs partition on a new ssd.


    Questions are:
    1) Would noatime break something important? Right now i have it set noatime just for '/' but all subvolumes still have relatime by default (based on /proc/mounts). I'm considering setting it for all subvolumes as well.
    2) It seems openSUSE figured out that there is ssd in use, and i saw ssd settings/profile been activated during boot. I also have added ssd argument in fstab and all volumes and subvolumes have it too (again /proc/mounts). To be honest i have no clue what 'ssd' setting does and i couldnt find any information about it
    3) is trim enabled by default? Maybe 'ssd' argument (see 2) above ) could take care of that?! systemctl status trim.timer reports following:

    Code:
    georgi@linux-f0hw:~> systemctl status fstrim.timer
    ● fstrim.timer - Discard unused blocks once a week
       Loaded: loaded (/usr/lib/systemd/system/fstrim.timer; disabled; vendor preset: enabled)
       Active: inactive (dead)
         Docs: man:fstrim
    
    
    but then there is /etc/cron.weekly/btrfs-trim already


    Schedulers are automatically set as they should for both ssd and the mechanical drive


    Any other optimizations to consider?


    Thanks!

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    32,337
    Blog Entries
    15

    Default Re: SSD settings: noatime/trim and btrfs ssd argument

    Hi
    The man page for btrfs (man 5 btrfs) ssd (and others) mount option is explained based on if the disk is rotational or not.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    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
    Aug 2008
    Location
    Brazil
    Posts
    3,240

    Default Re: SSD settings: noatime/trim and btrfs ssd argument

    Quote Originally Posted by georgi7 View Post
    1) Would noatime break something important? Right now i have it set noatime just for '/' but all subvolumes still have relatime by default (based on /proc/mounts). I'm considering setting it for all subvolumes as well.
    2) It seems openSUSE figured out that there is ssd in use, and i saw ssd settings/profile been activated during boot. I also have added ssd argument in fstab and all volumes and subvolumes have it too (again /proc/mounts). To be honest i have no clue what 'ssd' setting does and i couldnt find any information about it
    1) My fstab (mount by label):
    Code:
    LABEL=root                    /              btrfs noatime,nodiratime 0 0
    LABEL=home                  /home      xfs   noatime,nodiratime 1 2
    I've been running my LEAP 42.3 KDE/Plasma without apparent problems. I've read it is not indicated to suppress time stamps if you are running an e-mail server, for example.

    2) IFAIK it sets up garbage collection (fstrim) and, in the case of Windows, disable defrag and possibly sets a fixed size for it's swap file.

    Anyway, in this box I see:
    Code:
    :~> systemctl status fstrim.timer
    ● fstrim.timer - Discard unused blocks once a week
       Loaded: loaded (/usr/lib/systemd/system/fstrim.timer; enabled; vendor preset: enabled)
       Active: active (waiting) since Qua 2018-04-11 12:47:17 -03; 4 days ago
         Docs: man:fstrim
    
    Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
    So it seems yours is disabled.

  4. #4
    Join Date
    Sep 2012
    Posts
    7,101

    Default Re: SSD settings: noatime/trim and btrfs ssd argument

    Quote Originally Posted by georgi7 View Post
    To be honest i have no clue what 'ssd' setting does and i couldnt find any information about it
    "ssd" option changes space allocation algorithm by making btrfs prefer allocating new (larger) chunks over filling existing partial chunks. You may want to look in btrfs mailing list archives, there were several discussions on this topic over last year. It is believed that with modern hardware ssd option is hardly needed and may actually cause other problems (like premature out of space condition).
    is trim enabled by default? Maybe 'ssd' argument (see 2) above ) could take care of that?
    No, "ssd" option does not affect trim. Although one can argue that "ssd" should be accompanied by trim to actually achieve its goal.

  5. #5
    Join Date
    Feb 2018
    Location
    Romania
    Posts
    484

    Default Re: SSD settings: noatime/trim and btrfs ssd argument

    I read that is better to use a periodic trim than a continuous one (fstab with discard options).
    I trim weekly. fstrim -v /, fstrim -v /home...

  6. #6
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    20,925
    Blog Entries
    14

    Default Re: SSD settings: noatime/trim and btrfs ssd argument

    Quote Originally Posted by another_roadrunner View Post
    I read that is better to use a periodic trim than a continuous one (fstab with discard options).
    I trim weekly. fstrim -v /, fstrim -v /home...
    Source please? And, please tell me it's not this computertips site.
    I asked Greg KH years ago re. the matter of trimming. His response was to stick to the defaults, as provided by the distributions.
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  7. #7
    Join Date
    Feb 2018
    Location
    Romania
    Posts
    484

    Default Re: SSD settings: noatime/trim and btrfs ssd argument

    Sorry. You are right. Archlinux wiki with a link for a post of Theodore Ts'o.
    https://wiki.archlinux.org/index.php/Solid_State_Drive
    https://forums.freebsd.org/threads/s...1/#post-328912

  8. #8

    Default Re: SSD settings: noatime/trim and btrfs ssd argument

    Thanks all for the replies!

  9. #9

    Default Re: SSD settings: noatime/trim and btrfs ssd argument

    So i did run following (in that order)

    Code:
    systemctl start fstrim.timer
    systemctl enable fstrim.timer
    it says

    Code:
    georgi@linux-f0hw:~> systemctl status fstrim.timer            
     fstrim.timer - Discard unused blocks once a week
       Loaded: loaded (/usr/lib/systemd/system/fstrim.timer; enabled; vendor preset: enabled)
       Active: active (waiting) since Mon 2018-04-23 04:09:56 EEST; 13min ago
         Docs: man:fstrim
    
    

    I guess its up and active but how do i know if trimming have already been executed, or how long would it take. If its a process that takes time - what happens if i go and reboot the system in the middle of it?

  10. #10
    Join Date
    Feb 2018
    Location
    Romania
    Posts
    484

    Default Re: SSD settings: noatime/trim and btrfs ssd argument

    The trimming process last few seconds.
    You can see if it works with journalctl, weekly.
    If you are not sure about fstrim.service you can trim weekly but manually.

Page 1 of 5 123 ... LastLast

Posting Permissions

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