Announcement

Collapse
No announcement yet.

TRIM and SSD Configuration?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    TRIM and SSD Configuration?

    Hello, I have a fresh install of Kubuntu 16.04 LTS on my desktop PC. The computer is an i7 6700k processor, 16GB DDR4 memory, the OS is installed to LVM on a 256GB Samsung NVME drive. I have all of my storage files, eg Documents, Downloads, Pictures, etc on a separate 600 GB spinning drive, with symbolic links to those folders in my home directory. I haven't adjusted any settings for TRIM on the SSD, nor have I made any adjustments to the 16GB of swap that the system procured itself during installation. I see that there is a weekly cron job which reads '/sbin/fstrim --all || true'.

    Is there anything else I need to do to optimize my SSD? Should I get rid of the swap? I'm newish to Linux and any help would be greatly appreciated. Thank you!

    #2
    Probably your SSD will be fine as you have it configured. Unless you are encoding videos or doing other memory-intensive tasks, you are unlikely to use any swap, so that is probably wasted space (or you could make a swap partition on the hdd). Other things to do to minimize "wear" are in this blog from a couple years ago.

    Comment


      #3
      My personal opinion, swap is fine on an SSD and should be there. Swapping to disk is the slowest thing your computer does, why not use the fastest place for it if you use it? I mean what's the point of the SSD if it doesn't benefit your system performance? More importantly, tune your swap properly - if you even need it at all.

      Also, again just my opinion, a weekly trim is too often. I would do monthly at the most or even less often. If your worried about wear, do it twice a year or so, but if your SSD is not a super cheap one, weekly won't hurt.

      The reality is SSDs have come a long way in the last few years so most of the "expert" advice out there (not you Don, the WWW in general ) is way out-dated. Most modern SSDs will outlast your ability to write to them so most of these things don't really matter much.

      In related news, memory prices are supposed to tank this year so we'll all be upgrading again soon anyway...

      Please Read Me

      Comment


        #4
        Default install is fine.

        Comment


          #5
          Originally posted by mr_raider View Post
          Default install is fine.
          Yeah, it is.

          I do make some tweaks though - for instance I use noatime in fstab for all drives; can't figure out why I'd need last access time on a single user machine

          I run fstrim as a weekly cron job; takes about five seconds.

          I also have a udev rule that sets the I/O scheduler to deadline if we're talking to a non-rotating disk. udev rule looks like this -

          Code:
          # set deadline scheduler for non-rotating disks
          ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline"
          Hope this helps, but yes - default configuration is fine.
          we see things not as they are, but as we are.
          -- anais nin

          Comment


            #6
            Last time I checked, the schedulers were all set to deadline by default. The Ubuntu Kernel team decided this a while back, but it looks like it's changed.

            Code:
            [FONT=monospace][COLOR=#54FF54][B]stuart@office[/B][/COLOR][COLOR=#000000]:[/COLOR][COLOR=#5454FF][B]~[/B][/COLOR][COLOR=#000000]$ for i in {a..h} ; do cat /sys/block/sd${i}/queue/scheduler ; done   [/COLOR]
            noop deadline [cfq]  
            noop deadline [cfq]  
            noop deadline [cfq]  
            noop deadline [cfq]  
            noop deadline [cfq]  
            noop deadline [cfq]  
            noop deadline [cfq]  
            noop deadline [cfq]  
            [/FONT]
            Last edited by oshunluvr; May 22, 2017, 06:56 AM.

            Please Read Me

            Comment


              #7
              Actually, I guess is depends on what version you're using. It appears for 17.04 they've changed to CFQ as default. Or maybe it's a kernel thing. I'm using 4.10 so maybe CFQ is the best. I'll have to do more checking.
              Last edited by oshunluvr; May 22, 2017, 06:57 AM.

              Please Read Me

              Comment


                #8
                There, that's better:
                Code:
                [FONT=monospace][COLOR=#54FF54][B]stuart@office[/B][/COLOR][COLOR=#000000]:[/COLOR][COLOR=#5454FF][B]~[/B][/COLOR][COLOR=#000000]$ for i in {a..h} ; do cat /sys/block/sd${i}/queue/scheduler ; done[/COLOR]
                noop deadline [cfq]  
                noop deadline [cfq]  
                noop deadline [cfq]  
                noop deadline [cfq]  
                noop deadline [cfq]  
                noop deadline [cfq]  
                noop [deadline] cfq  
                noop [deadline] cfq 
                [/FONT]
                Source: https://wiki.debian.org/SSDOptimizat...y_IO-Scheduler

                Please Read Me

                Comment


                  #9
                  I like setting the browser to cache in /run/user/user# because the cache disappears at shutdown or reboot -- the SSD wear reduction is a side benefit.

                  Swap -- with 16GB, OP will have to get into some heavy-duty video editing or run 20 VMs or something to ever need swap space. The last time I saw swapping was years ago when I used gimp to compile 215 sequential .gif format photos into a movie.
                  Last edited by dibl; May 22, 2017, 01:43 PM.

                  Comment

                  Working...
                  X