The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    Trim SSD on Ubuntu?

    Discussion in 'Linux Compatibility and Software' started by NickKas, May 30, 2014.

  1. NickKas

    NickKas Notebook Enthusiast

    Reputations:
    0
    Messages:
    20
    Likes Received:
    1
    Trophy Points:
    6
    Hey guys,

    Does anybody knows how to trim SSD on Ubuntu 14.04 LTS?
     
  2. Jarhead

    Jarhead 恋の♡アカサタナ

    Reputations:
    5,036
    Messages:
    12,168
    Likes Received:
    3,134
    Trophy Points:
    681
  3. NickKas

    NickKas Notebook Enthusiast

    Reputations:
    0
    Messages:
    20
    Likes Received:
    1
    Trophy Points:
    6
    :thumbsup:
     
  4. Primes

    Primes Notebook Deity

    Reputations:
    919
    Messages:
    1,736
    Likes Received:
    718
    Trophy Points:
    131
  5. ALLurGroceries

    ALLurGroceries  Vegan Vermin Super Moderator

    Reputations:
    15,730
    Messages:
    7,146
    Likes Received:
    2,343
    Trophy Points:
    331
  6. NickKas

    NickKas Notebook Enthusiast

    Reputations:
    0
    Messages:
    20
    Likes Received:
    1
    Trophy Points:
    6
    well,I found this command

    sudo fstrim -v /

    on the net and it works!check it out!
     
    UNCNDL1 likes this.
  7. oled

    oled Notebook Evangelist

    Reputations:
    221
    Messages:
    587
    Likes Received:
    33
    Trophy Points:
    41
    If you want it to be permanently activated you have to set the discard flag in /etc/fstab. It should look something like this.
    Code:
    /dev/sdaX  /       ext4   defaults,noatime,discard   0  1
     
  8. Pursuvant

    Pursuvant Notebook Enthusiast

    Reputations:
    49
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    15
    Please don't add "discard" to fstab, it will cause a trim every time you delete. I just set up a new Ubuntu laptop, here is a link to the complete list of things that need to be done to optimize and SSD

    https://sites.google.com/site/easyl...omatic-TRIM-by-rc.local-by-cron-or-by-discard
     
  9. oled

    oled Notebook Evangelist

    Reputations:
    221
    Messages:
    587
    Likes Received:
    33
    Trophy Points:
    41
    Yes, and that's exactly what you want to do with the discard option.


    Please don't?
    Just because you prefer to trim manually, does not mean everybody does
     
  10. Pursuvant

    Pursuvant Notebook Enthusiast

    Reputations:
    49
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    15
    My observation is, respectfuly, if you research you will find the 'discard' approach makes every delete operation you throw at disk, 50+ times slower than it needs to be. Not exactly why i invest in SSD's, to slow them down by less than optimal choices about alignment or trimming. Your mileage may vary
     
  11. boukyaku

    boukyaku Notebook Consultant

    Reputations:
    19
    Messages:
    167
    Likes Received:
    2
    Trophy Points:
    31
    Right, apparently adding discard to the appropriate disk in fstab will slow the SSD down on only the manipulation of a massive amount of small files. Otherwise, you won't notice a difference.

    Adding noatime seems to lessen the wear/tear as well.

    Anyway, Ubuntu 14.04 comes with TRIM support out of the box if your SSD is intel/samsung. All it does is issue the fstrim command on your SSD(s) once a week.
     
    UNCNDL1 likes this.
  12. alexhawker

    alexhawker Spent Gladiator

    Reputations:
    500
    Messages:
    2,540
    Likes Received:
    792
    Trophy Points:
    131
    But not Crucial?
     
  13. Temetka

    Temetka Notebook Consultant

    Reputations:
    30
    Messages:
    221
    Likes Received:
    25
    Trophy Points:
    31
    How about for Linux Mint 17 Qiana? I am dual booting between that and Windows 7. Thanks.
     
  14. JOSEA

    JOSEA NONE

    Reputations:
    4,013
    Messages:
    3,521
    Likes Received:
    170
    Trophy Points:
    131
    Glad you asked, I have read this thread a few times M500/M5x0 QUEUED-TRIM data corruption alert (mostl... - Crucial Community and honestly am not sure of the answer. I just installed U 14.04.1 LTS and updated to the current stable kernel 3.16 ... on my M500 and no issues so far.
    After reading this http://www.spinics.net/lists/linux-ide/msg48361.html it seem if you are on MU05 firmware and Kernel 3.15 or above there should be no fear of data loss, can anyone confirm this or am I misreading ?
    Thanks for any inputs!
     
  15. 3Fees

    3Fees Notebook Deity

    Reputations:
    541
    Messages:
    970
    Likes Received:
    136
    Trophy Points:
    56

    Linux Mint 17 codename Qiana. is based on Ubuntu 14.04

    Linux Mint 17 Cinnamon Release Notes - Linux Mint


    Cheers
    3Fees :)

    I have Linux Mint 17.1 -Cinnamon -code named -Rebecca on my HP DV5000 Laptop with the 17.1 updated kernel,,can install 17.1-Rebecca from updates on Qiana, then install the updated Kernel as well. I did last night, very easy all bumps,ect pre-figured out by the Linux Mint team, Clem,ect,,check it out... :)
     
  16. Mr.Koala

    Mr.Koala Notebook Virtuoso

    Reputations:
    568
    Messages:
    2,307
    Likes Received:
    566
    Trophy Points:
    131
    There was a time when the Linux kernel implemented TRIM in a less than idea way and enabling discard would result in sending a large number of small TRIMed address ranges in a row, which is why people say discard is very bad for performance.

    Basically instead of saying this:
    the kernel says this:
    This has been fixed.


    If your file system is heavily fragmented or you're handling many small files, in-line TRIM would still slow things download a bit upfront, but you get cleaner FTL and more efficient GC in the long run. Obviously, there's even less reason not to enable TRIM if you have queued TRIM support (which you do on a modern Linux kernel when not running the buggy M5X0).
     
    Last edited: Dec 22, 2014
    Dufus likes this.
  17. tmpfs

    tmpfs Notebook Enthusiast

    Reputations:
    0
    Messages:
    22
    Likes Received:
    4
    Trophy Points:
    6
  18. Dufus

    Dufus .

    Reputations:
    1,194
    Messages:
    1,336
    Likes Received:
    548
    Trophy Points:
    131
    If that's how it was done then "less than ideal" would be a massive understatement.
     
  19. Mr.Koala

    Mr.Koala Notebook Virtuoso

    Reputations:
    568
    Messages:
    2,307
    Likes Received:
    566
    Trophy Points:
    131
    M550 MU02 firmware update

    M500/M5x0 QUEUED-TRIM data corruption alert (mostl... - Page 5 - Crucial Community