Trim Support in Ubuntu 14.10

Discussion in 'all things UNIX' started by oliverjia, Oct 6, 2014.

  1. oliverjia

    oliverjia Registered Member

    Joined:
    Jul 21, 2005
    Posts:
    1,517
    Dear all,

    I search the Internet but could not find a description of whether Ubuntu 14.10 will support the trim function of SSDs(other than Samsung and Intel ones, which are supported by Ubuntu 14.04) by default. Anyone has inside information on how well 14.10 will support trim?

    thanks
     
  2. Kyle1420

    Kyle1420 Registered Member

    Joined:
    May 27, 2008
    Posts:
    479
  3. Mrkvonic

    Mrkvonic Linux Systems Expert

    Joined:
    May 9, 2005
    Posts:
    8,694
    Don't do anything. If it's not enabled, don't do it yourself. You can corrupt your data.
    Mrk
     
  4. oliverjia

    oliverjia Registered Member

    Joined:
    Jul 21, 2005
    Posts:
    1,517
    Thank you Kyle. Yes it appears there is a "vendor check" built in for Ubuntu 14.04 - trim will not be enabled by default if the SSD is not Intel or Samsung.

    http://askubuntu.com/questions/18903/how-to-enable-trim
     
  5. oliverjia

    oliverjia Registered Member

    Joined:
    Jul 21, 2005
    Posts:
    1,517
    Hi Mrk,

    Not sure if you are joking or not, but I tried to do "trim" manually but it takes much much longer time to do it than the time doing it on Windows 8.
     
  6. Mrkvonic

    Mrkvonic Linux Systems Expert

    Joined:
    May 9, 2005
    Posts:
    8,694
    I am not joking. Why everyone thinks raw device operations should be activated manually if the distro devs and device devs do not?
    Mrk
     
  7. oliverjia

    oliverjia Registered Member

    Joined:
    Jul 21, 2005
    Posts:
    1,517
    well, 2 reasons: trim does help keep the SSD fast; and Ubuntu 14.04 does enable trim for Intel and Samsung. To be honest, I don't think the quality of an Intel or Samsung will always be better than other brands, that one's data will be safe on Intel/Samsung, while not safe on other SSDs. It has a lot to do with model for each brand.
     
  8. Mrkvonic

    Mrkvonic Linux Systems Expert

    Joined:
    May 9, 2005
    Posts:
    8,694
    No, it has to do with raw device commands. And the speed thing is mostly irrelevant for normal people. There's a reason why some of the drives have trim, and that's a decent driver and firmware. Therefore, I most warmly recommend you do not tinker, because you can easily destroy your device.
    Mrk
     
  9. NGRhodes

    NGRhodes Registered Member

    Joined:
    Jun 23, 2003
    Posts:
    2,331
    Location:
    West Yorkshire, UK
    Mrk is right, there have been reports of corruption due to the use of trim in Linux (and has also happened in other OS too). How much of an issue it is now with current drives, I don't know. But kernel bugs, filesystem bugs and SSD bugs could all trigger corruption
    Ubuntu do state Intel/Samsung support by default as they are well tested.

    A list of trimmed unallocated blocks is stored in memory by the kernel, the first fstrim by Linux after a reboot causes a trim on all unallocted blocks, subsequent fstrims should be much faster as the kernel now has an accurate picture of which unallocated blocks have already been trimmed.

    When a Trim command is sent to the SSD, it is simply a list of unallocated blocks. It is up to the SSD to choose which blocks to garbage collect and when, Trim commands are hints and no return codes of success/failure given - which is why its possible to get silent corruption from a buggy SSD.

    Whatever you do, test !


    http://article.gmane.org/gmane.comp.file-systems.ext4/41974


    Cheers, Nick
     
  10. oliverjia

    oliverjia Registered Member

    Joined:
    Jul 21, 2005
    Posts:
    1,517
    Thanks Nick and Mrk for the info. I see the problem now.
    It appears it's better just follow the default setting for now. Yeah it'll be much better if the SSD vendors open-source their firmware.
     
Loading...