Results 1 to 10 of 41

Thread: TRIM and SSD Support

Hybrid View

  1. #1
    Join Date
    Dec 2008
    Beans
    426

    TRIM and SSD Support

    Read through a couple of TRIM threads from before 10.10 was released and also this little bit over at omgubuntu from a poster:

    Here's what (I think) I know:

    *

    The kernel has TRIM support as of 2.6.33 (Maverick is 2.6.35).
    *

    EXT4 has TRIM support but only when journaling is turned off.
    *

    The way TRIM works in the kernel is very basic and quite slow. Disks following the specs can accept multiple ranges but the kernel currently can only do one range at a time. This comes from something I read perhaps a month ago. I wish I had the source as this might not be true or might no longer apply.

    Journalling is what kills it for me. Data corruption is a PITA.

    However the newer versions of hdparm (v9.25 - Maverick is at v9.27) come with a script called wiper.sh which performs a quick analysis of a drive and then trims all the empty space. Rather than lose features, I find it much easier to cron wiper.sh to run once a week (or once a day/month/whatever). SSD degradation for an OS drive doesn't happen that fast unless you're constantly tearing things up. You don't need realtime TRIMming.

    There is also a GUI frontend called DiskTRIM which doesn't appear to be in the repos. Less experienced users might find this easier to use than setting up cron jobs.

    There are PPAs for hdparm and disktrim and all can be run on Lucid (and further back) without need for 2.6.33+ kernels.
    My question is if TRIM is now completely and optimally (as in, quite well) supported in 10.10? Should I wait for BTRFS? What are the effects of journalling? What will I lose if I go with non-journalled? Thanks
    Last edited by Andy06; October 14th, 2010 at 11:17 AM. Reason: Adjust quotes

  2. #2
    Join Date
    Jun 2008
    Beans
    37
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Talking I can answer one question!

    Well, I can attempt to answer the last part.

    Journaling keeps track of read and write operations. This is good because in the event of a sudden system failure (power outage, kernel panic, etc), the system knows which operations were currently going on by looking at the journal and has a chance to try and complete them. Without journaling, the system has to go through the entire HD and look for broken files to fix whenever there is some sort of failure. And even then it has less of a chance of recovering them than if it knew exactly what was going on in the first place.

    Journaling is a very standard feature. NTFS, HFS+, and EXT3 and 4 all support it.

    If you've ever used a Microsoft OS on FAT32, you know how much of a pain running without Journaling is. Every BSOD=35 min disk scan before being able to use the computer again.
    Last edited by Techrocket9; October 14th, 2010 at 07:13 AM.

  3. #3
    Join Date
    Feb 2005
    Location
    Melbourne, Australia
    Beans
    13,510
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: TRIM and SSD Support

    Quote Originally Posted by Andy06 View Post
    Read through a couple of TRIM threads from before 10.10 was released and also this little bit over at omgubuntu from a poster:

    Here's what (I think) I know:
    .........
    EXT4 has TRIM support but only when journaling is turned off.
    Rubbish.

    *Some* people say that turning off journaling on a SSD device is good because it simply reduces the overall quantity of writes to the device, it has nothing to do with TRIM mechanism which is allowing the SSD to know about unused data blocks so it can share the "wear" of writes more evenly over the device and therefore extend its operational life.

    Trading off the ongoing operational benefits of journaling for the possibility of extending the life of a piece of hardware that may well be chucked out long before it does die is a dubious choice at best.
    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

  4. #4
    Join Date
    Feb 2010
    Beans
    218

    Re: TRIM and SSD Support

    Quote Originally Posted by Andy06 View Post
    EXT4 has TRIM support but only when journaling is turned off.
    who did you tell this wrong stuff?
    that's simply not true. to have trim working with extX you need to add "discard" as mount option e.g. in your fstab.

    it works without any problems with ext4 with and without journaling. i even made some test myself to verify trim works.

    if you are already adding an option in fstab i recommend adding also "noatime" to improve lifetime and performance a bit.

    edit: btw. most modern ssds also have garbage collection. this means they do not need trim support to "trim". it's done automatically during idle times. ofcourse os trim support makes it more effective.
    Last edited by a-user; October 14th, 2010 at 10:37 AM.

  5. #5
    Join Date
    Dec 2008
    Beans
    426

    Re: TRIM and SSD Support

    If you've ever used a Microsoft OS on FAT32, you know how much of a pain running without Journaling is. Every BSOD=35 min disk scan before being able to use the computer again.
    Isn't that the case on NTFS too? If Vista shuts down unexpectedly due to power failure, it does a full 1 hour disk check (which can be skipped of course). Ubuntu's "disk check" is much faster. So does NTFS have journalling enabled?

    that's simply not true. to have trim working with extX you need to add "discard" as mount option e.g. in your fstab.

    it works without any problems with ext4 with and without journaling. i even made some test myself to verify trim works.

    if you are already adding an option in fstab i recommend adding also "noatime" to improve lifetime and performance a bit.
    Wait, so I need to manually edit something? On 10.10, isn't it enough to just replace the drive and install as you would on an HDD?

  6. #6
    Join Date
    Feb 2010
    Beans
    218

    Re: TRIM and SSD Support

    so many wrong infos in this thread

    1. ntfs has journaling too BUT a somehow simpler one. that ntfs is one of the worst modern filesystems should not be the topic of this thread. anyhow it has journaling and it works.

    2. as far as i know you must add the "discard" option. i know this for sure that it was needed before 10.10 (if you used a kernel with trim support). i am not sure if in the actual current release there has been add to detect it automatically.
    i did not tested if trim works without the discard option. but with it does 100%.

    trim has nothing to do with journaling. there are no restriction from ext-filesystem using journaling on trim support.

    p.s. correct alignment of ssd partitions does the installer at least since lucid.

  7. #7
    Join Date
    Oct 2007
    Location
    Japan
    Beans
    637
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: TRIM and SSD Support

    here is some info on wiper.sh
    http://ubuntuforums.org/showthread.php?t=1532733&page=1

    But does it matter if the drive is mounted when it runs?

    So if I understand correctly I should have all my bases covered if 1. I have 10.10 and "discard" option enabled in my fstab file
    2. The SSD supports trim and has garbage collection.
    3. Run wiper.sh once a week using a cron job.

    Am I missing anything?
    "Don't Panic"

  8. #8
    Join Date
    Feb 2010
    Beans
    218

    Re: TRIM and SSD Support

    1. yes. that's all you need to do.
    2. garbage collection is something you do not need to think about. it works automatically despite the operating system you use.
    3. why you want to do this? i even do not know what it really does. it sounds quite useless and risky to me. the system will trim unused blocks automatically if you activated trim (discard) and if your ssd has garbage collection that it does it also during idle times without the help of the system.

    hence brief: only put "discard" as mount option to your extX partition on a ssd drive (optionally also add also "noatime", what i recomend).

    that's all.

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
  •