Results 1 to 8 of 8

Thread: SSD: To Trim Or Not To Trim?

  1. #1
    Join Date
    Jul 2010
    Location
    London
    Beans
    507
    Distro
    Ubuntu 14.04 Trusty Tahr

    SSD: To Trim Or Not To Trim?

    I've had a SSD (OCZ AGILITY 3 SATA III 2.5" 120G) for a couple of months now. I have my root partition on it and using a separate HDD for /home and I must say it all runs like greased lightning, I'd highly recommend it.

    Anyway, up until now I've been blissfully unaware of Trim but I've just been googling various forum posts and now I'm wondering if it's a good idea to enable trim to minimise wear and tear on my SSD. Does anyone have any advice on whether it's recommended or not?

  2. #2
    Join Date
    Jan 2011
    Beans
    1,151

    Re: SSD: To Trim Or Not To Trim?

    Quote Originally Posted by jim_deadlock View Post
    I've had a SSD (OCZ AGILITY 3 SATA III 2.5" 120G) for a couple of months now. I have my root partition on it and using a separate HDD for /home and I must say it all runs like greased lightning, I'd highly recommend it.

    Anyway, up until now I've been blissfully unaware of Trim but I've just been googling various forum posts and now I'm wondering if it's a good idea to enable trim to minimise wear and tear on my SSD. Does anyone have any advice on whether it's recommended or not?
    yep it is a good idea
    writes are bad on a ssd
    trim is just a feature on ssd just like smart on a hdd
    http://en.wikipedia.org/wiki/TRIM
    what you want is discard and noatime
    https://wiki.archlinux.org/index.php/Solid_State_Drives
    Last edited by idoitprone; May 19th, 2012 at 04:53 AM.
    (\ /)
    (O.o)
    (> <)
    This is Bunny. Copy Bunny into your signature to help him on his way to world domination.

  3. #3
    Join Date
    Jun 2009
    Location
    Chicago Suburbs
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: SSD: To Trim Or Not To Trim?

    I did not add discard to my fstab right away, but have now. I did find the site below where the poster is against trim but wants a cron task every night. I ran that just after setting discard and it showed it did something.

    HOWTO: Check If TRIM On Ext4 Is Enabled And Working On Ubuntu And Other Distributions
    http://sites.google.com/site/lightru...bledandworking

    Not required with newer kernels
    http://disktrim.sourceforge.net/
    Typical fstab entry:
    UUID=d65e4ad3-6315-4838-97a1-ec574cb8575f / ext4 noatime,discard,errors=remount-ro 0 1

    https://wiki.archlinux.org/index.php..._Cell_Clearing
    hdparm -I /dev/sdX
    Alternate to discard, call fstrim via cron
    http://opensuse.14.n6.nabble.com/SSD...td3313048.html

    fred@fred-Precise:~$ sudo fstrim -v /
    /: 23267893248 bytes were trimmed

    fred@fred-Precise:~$ cat /sys/block/sda/queue/scheduler
    noop deadline [cfq]
    For info on UEFI boot install & repair:
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to close thread when/if answered completely.







  4. #4
    Join Date
    Jul 2010
    Location
    London
    Beans
    507
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: SSD: To Trim Or Not To Trim?

    Checking if TRIM is working I get exactly the same result both with and without the tempfile. Note the first 4 lines are not zeros, so I'm not sure whether this meets the requirement of "If TRIM is properly working the result of the last command should be a bunch of zeros"...?

    EDIT: well I've updated my fstab so I guess I'm all set, thanks guys.

    Code:
    # hdparm --read-sector 4096 /dev/sda
    
    /dev/sda:
    reading sector 4096: succeeded
    8100 0000 8100 0001 8100 0002 8100 0003
    8100 0004 8100 000c 8100 000d 8100 0018
    8100 0028 8100 003e 8100 0079 8100 00ab
    8100 0138 8100 016c 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    0000 0000 0000 0000 0000 0000 0000 0000
    Last edited by jim_deadlock; May 19th, 2012 at 05:49 AM.

  5. #5
    Join Date
    Feb 2005
    Location
    Melbourne, Australia
    Beans
    13,505
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: SSD: To Trim Or Not To Trim?

    Quote Originally Posted by jim_deadlock View Post
    .........
    Anyway, up until now I've been blissfully unaware of Trim but I've just been googling various forum posts and now I'm wondering if it's a good idea to enable trim to minimise wear and tear on my SSD.
    TRIM has absolutely nothing to do with "minimise wear and tear on my SSD", it is solely to keep the SSD's write performance at maximum.

    Without having TRIM used on every partition on the SDD eventually any writes will eventually exhaust the pool of unused blocks and force the SSD to basically take 3 times longer to re-write blocks (Copy, Erase then Write versus Write).

    TRIM lets the SSD erase blocks in the background once it is informed that they are no longer used.
    Regards, David.
    Please use the Forum search and Wiki search for immediate help
    Please mark your thread as Solved when appropriate
    New to technical forums?: How To Ask Questions The Smart Way

  6. #6
    Join Date
    May 2012
    Beans
    35

    Re: SSD: To Trim Or Not To Trim?

    Yep you absolutely want discard & noatime.

    Over a year ago, I got one of the smallest & slowest SSDs obtainable. And it is still snappy. That is, it boots noticably faster than any other PC in the house and loads applications quickly. My fstab is similar to oldfred's "typical" example.

    I've tried to reduce writes to the SSD ("wear and tear") by putting /var on a spinning data drive, and by mounting /tmp in RAM.

  7. #7
    Join Date
    Oct 2007
    Beans
    21

    Re: SSD: To Trim Or Not To Trim?

    I am wondering what to do with the information in this thread. I have a ssd and feel no issue with performance so far. Ubuntu 12.04 takes 12 seconds to load from power on as an example (edit 2: but guess the conserns in this thread is about writing perfromance and durability of writing performance). I do not like to mess with system if I do not have to but of course I'd like to get the best out of my hardware.

    I really think Ubuntu should take care of matters like this. Have anyone adressed this issue for the developers?

    Edit: I added noatime and discard to options for my ssd in fstab as well. Hope that is good.
    Last edited by risotto77; May 20th, 2012 at 12:46 PM.

  8. #8
    Join Date
    Jan 2008
    Location
    queensland, australia
    Beans
    88
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: SSD: To Trim Or Not To Trim?

    I really think Ubuntu should take care of matters like this. Have anyone adressed this issue for the developers?
    Everybody's system is different so it's a bit hard for the developers. For example I have a mixed SSD/HDD system so I can't enable noop or deadline in grub - I used the sysfsutils utility.

    I agree with all that discard and noop (or deadline) are essential but I believe that the current crop of SSDs are much more robust than they used to be in terms of write cyles and the lengths that some peple go to to reduce them are no longer appropriate. Personally I have enabled noatime and moved the tmp directory to ramdisk but that's it.

Bookmarks

Posting Permissions

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