Slashdot Mirror


Out-of-the-Box, Ubuntu 14.04 LTS To Support TRIM On SSDs

First time accepted submitter Maurits van der Schee writes "Where in older versions you had to add a cron job calling "fstrim" or mounting with the "discard" option in fstab, the new LTS (Long Term Stable) version of Ubuntu Linux will automatically enable TRIM for your SSD. Good news for hardware enthusiasts!"

29 of 133 comments (clear)

  1. Stable? by Anonymous Coward · · Score: 5, Informative

    "LTS is an abbreviation for "Long Term Support"."

  2. Defeats pleasure of unnecessary labour by Twinbee · · Score: 4, Funny

    But surely this defeats the perceived satisfaction of tweaking and fixing it all up manually? Where's the fun in that?

    --
    Why OpalCalc is the best Windows calc
    1. Re:Defeats pleasure of unnecessary labour by TeknoHog · · Score: 4, Interesting

      But surely this defeats the perceived satisfaction of tweaking and fixing it all up manually? Where's the fun in that?

      If that's your thing, use Gentoo instead. At least that's what I do. In case you're being sarcastic, the fun IMHO is in learning about your system and understanding why distros make the choices they do. I think my first week with Linux taught me more about computers than years with DOS/Windows, and I still wonder how a Windows machine can be anyone's "Personal Computer".

      --
      Escher was the first MC and Giger invented the HR department.
    2. Re:Defeats pleasure of unnecessary labour by Anne+Thwacks · · Score: 2

      Goatse.sx - You must be new here.

      --
      Sent from my ASR33 using ASCII
  3. Re:It's Long-term support... by Anonymous Coward · · Score: 2, Informative

    along with the typical comments about Windows 7 having the feature since introduction

    Well, let me be that guy... ;)

    Windows implements TRIM command for more than just file delete operations. The TRIM operation is fully integrated with partition- and volume-level commands like format and delete, with file system commands relating to truncate and compression, and with the Volume Snapshot feature.[1]

  4. Taking too long by Anonymous Coward · · Score: 5, Insightful

    This is way overdue.

    It's also taking too long for file systems that provide snapshot features to become mainstream and default as well. And no, LVM snapshots aren't good enough.

    No, I'm not going to write the patches. They wouldn't be accepted in any case. Fundamental features such as the IO stack and file systems are now the exclusive purview of well-heeled outfits like Red Hat, Oracle, Intel, OSDL, etc. and and their stable of full time developers.

    They just need to do their jobs and get it done.

    1. Re:Taking too long by darkpixel2k · · Score: 5, Funny

      I've been choosing btrfs through the debian installer for at least a couple of years now.

      Dude you so have to try ZFS. It's aweso--

      Yes, I know it's not as awesome as ZFS, but it still beats mdraid and lvm.

      Oh--sorry. Got ahead of myself there. Good thing you stopped me in time.

      --
      There's no place like ::1 (I've completed my transition to IPv6)
  5. WHAT THE FUCK ARE YOU DOING?! by Anonymous Coward · · Score: 5, Funny

    HOLY FUCK, MAN! JUST WHAT THE HELL DO YOU THINK YOU'RE DOING?!?!?!

    This is Slashdot, for crying out loud. How DARE you bring facts and correct information to the discussion here! THAT IS NOT ALLOWED! You just can't do that! FUCK!

    1. Re:WHAT THE FUCK ARE YOU DOING?! by voss · · Score: 2

      I wish I had a +1 funny mod point for him

    2. Re:WHAT THE FUCK ARE YOU DOING?! by Anonymous Coward · · Score: 2, Informative

      You don't waste mod points on an AC

      Mod up good ideas. The name (or lack therof) is irrelevant.

  6. TRIM not always good by girlintraining · · Score: 5, Interesting

    the new LTS (Long Term Stable) version of Ubuntu Linux will automatically enable TRIM for your SSD. Good news for hardware enthusiasts!"

    And terrible news for encryption experts. Enabling TRIM tells your adversary which sectors contain data and which don't. It's a great asset to cryptanalysis and also destroys plausible deniability that there's a filesystem present on the drive, and how much data is present in it -- thus eliminating the "shadow volume" option of Truecrypt and others.

    --
    #fuckbeta #iamslashdot #dicemustdie
    1. Re:TRIM not always good by Anonymous Coward · · Score: 5, Interesting

      No, YOU clearly don't know what you're talking about, and yet are arrogant as all hell.
      The problem arises from the fact that while HDDs have only 2 operations (read, write) and therefore have no distinction outside the file-system of what is "free" and what is "allocated", SSDs have 3 (read, write, free), because SSDs label sectors as "free" or "allocated" (that is, the hardware itself, not just the file-system). So for a standard HDD encryption, the procedure goes: overwrite hard drive with random data, create encrypted partition, install OS on encrypted partition (last step optional, of course). What this accomplishes is that an attacker who examines the disk can't tell the difference between what is and isn't written to, since the unwritten data is random and the written data is encrypted (i.e. indistinguishable from random, if done correctly). On a TRIM-enabled SSD though, the OS sees all these unused sectors and proceeds to mark them as Free. That is a huge fucking problem, for the roughly the reasons the GP stated. In particular, it's egregiously bad for users of hidden volumes, since that hidden volume will never be TRIMed, and the attacker who can rubber hose your outer volume can see a chunk of disk that hasn't been trimmed, yet isn't allocated in the partition you gave them. They can now rubber hose THAT partition as well, whereas previously there was no way to know it even existed (in theory at least, the cryptsetup guys don't buy that).

      If you don't believe this is an issue, then ask the Truecrypt devs:
      http://www.truecrypt.org/docs/trim-operation

      or the LUKS/dm-crypt devs:
      http://asalor.blogspot.com/2011/08/trim-dm-crypt-problems.html

      Please be more respectful in the future, as we're wrong more often than we like to think.

    2. Re:TRIM not always good by Anonymous Coward · · Score: 3, Funny

      He can't be wrong though, he's already marked at Score 4: Insightful at the time of this post. And since Slashdotters are so smart and intelligent the score must be correct, right?

      I dunno. Problem is it's hard to know who's right and who's not. All I know is that Windows 7 had TRIM support automatically enabled for SSDs back in 2009 and the leading Linux distro's only finally going to enable it in 2014. No wonder so many people still see Linux as old and not suitable for end-user machines.

    3. Re:TRIM not always good by fisted · · Score: 3, Insightful

      Wow you seem to be one egocentric person.

    4. Re:TRIM not always good by LordLimecat · · Score: 5, Insightful

      Dude, youre overstating the threat.

      If the drive is encrypted, theres no more or less threat from brute-forcing.

      From a plausible deniability standpoint, Im not terribly sure how helpful that is ANYWAYS. If someone wants to know if youre using truecrypt, they could, I dont know, look at the MBR and see whether its using the Truecrypt bootloader. The idea that you can say "What partition?" when goons grab your mysteriously unreadable laptop is laughable. Im sure there are super corner cases where that would be helpful, but generally if youre being held by the sorts of people who have the means and ability to do rubber hose cryptography, theyre not going to put up with your BS about "but wait look i gave you a password that boots to an Ubuntu partition which only accounts for 1/2 of the drive's size, and has no data worth encrypting whatsoever!"

      Being involved with multiple organizations which employ encryption for very different reasons, none of them use plausible deniability / hidden encryptions; Id reckon because its not terribly helpful, or even plausible.

    5. Re:TRIM not always good by craighansen · · Score: 2

      (1) [Easiest solution] Turn off TRIM usage on encrypted volumes - loss of peak performance, but now you've got your "plausable deniability" back

      (2) [Adequate solution] Fix the firmware so that reading a TRIMed block causes random data to be written to it. However, you had better make sure that exactly the same power usage and timing comes from this activity compared to reading a previously-written block. You had also better be sure that the data is really random, so it can't be distinguished from encrypted data. You must also protect the meta-information as to the number of free and erased blocks.

      (3) [Problematic solution] Do not attempt to simply return psuedo-random data for blocks that have been TRIMed - you must ensure both that additional reads return the same data (such as by seeding the PR generator with the block number) and that performing additional TRIMs on the block cause different data to be returned, so that the ruse cannot be detected by reading the block, performing a TRIM, and reading the block again to see if it's the same. This is actually difficult, as any finite amount of state representing the seed could be detected by multiple TRIM/read cycles, although the effort required grows exponentially with the amount of state used.

    6. Re:TRIM not always good by Khyber · · Score: 2

      Your method of cultivation is likely wasteful, polluting, and irresponsible.

      I can do it at 10% of the price you do, using 1/8 the land area, consuming between 60-90% less water, and a ~50% reduction in required fertilizers. Because it's in a much smaller area, the requirement of machines for harvesting is gone. My production buildings can be entirely solar-powered, as well.

      Morocco, Australia, China, UK, Japan, USA, Brazil, all utilize my technology.

      Your seed stock, if not from Monsanto, or produced yourself, likely came from a building utilizing my technologies.

      Been on the BBC for the same tech.

      --
      Still waiting on Serviscope_minor to wake up to fucking reality and realize that Jessica Price isn't going to fuck him.
    7. Re:TRIM not always good by Khyber · · Score: 2

      Your joke was pretty poor, and your arguments equally weak. Soil based farming is wasteful. It's proven. It is resource-intensive and uses more than what is truly needed. You're wasting your own resources and wallowing in your ignorance.

      Your 'it's called a greenhouse' quip is out of line, too. We make things grow without light - http://www.youtube.com/watch?v=9ZTikdxj8AI and that tech has recently been expanded into growing lettuces herbs, and more (and not typical lightless crops.)

      --
      Still waiting on Serviscope_minor to wake up to fucking reality and realize that Jessica Price isn't going to fuck him.
  7. Your other fun by tepples · · Score: 2

    The fun in having a distribution automatically do the right thing is that you get to a working system faster, so that you can get to your other fun faster, whether you prefer casual, hardcore, or Dwarf Fortress.

  8. TRIM? who needs it! by sshir · · Score: 3, Insightful

    Well, if you don't do random writes, you don't need TRIM.

    How to get away from random writes you ask? Simple! Just use BTRFS.

    "But my database!" you say. Well, the answer is simple - time to move away from 50 year old technology and to a modern database engine, the kind that doesn't do random writes either (fractal tree based, for example).

    Disclaimer: All of the above is not written for stodgy "enterprise level" types.

    1. Re:TRIM? who needs it! by Anonymous Coward · · Score: 2, Funny

      partition Czechoslovakia

    2. Re:TRIM? who needs it! by TheDauthi · · Score: 2

      Excitement is a bug - not a feature - in a filesystem.

    3. Re:TRIM? who needs it! by LordLimecat · · Score: 2

      Im not entirely sure you understand what TRIM does. Its not to get rid of random writes, its to deal with a scenario where you have written and deleted 120GB from a 120GB SSD. Your OS has marked 120GB as "deleted", but those blocks are still occupied and cannot be re-written until they are first erased. This incurs a penalty, particularly since the erase block size is typically larger than the FS cluster size.

    4. Re:TRIM? who needs it! by LordLimecat · · Score: 2

      That is not correct: its not about doing anything safely or even about wear-leveling. The filesystem is what handles writes, and it knows where is safe to write to, and wear-leveling is helped by TRIM but that is not what TRIM actually does.

      TRIM simply informs the drive that it can perform an erase on a particular block when the filesystem marks it as deleted. This is so that any erases or remapping that needs to happen can e done when the drive is idle-- basically, it triggers garbage collection. With TRIM and auto-garbage collection off, the drive into a brick wall when it needs to write 10GB of data and it turns out that there are no already blanked blocks available; in that case it would have to do read-erase-writes for 10GB or more (due to amplification) worth of blocks, slowing everything to a relative crawl.

      Just about everything an SSD does is improved by garbage collection, and TRIM is just OS- / FS- triggered garbage collection.

    5. Re:TRIM? who needs it! by Rockoon · · Score: 2

      sigh this isnt exactly right either

      The situation is thus:

      An SSD is a physical storage that presents a logical drive to the system. There is no 1:1 mapping between physical sectors and logical sectors. Logical sector 0 is always the boot sector, but can be located anywhere on the physical media.

      An SSD is also unaware of the file system that is present. Prior to TRIM the entire logical volume, including all of its free sectors, were always allocated to physical locations and the SSD was unaware of which physical/logic blocks were considered free by the filesystem. This meant that the SSD could never treat the logical blocks allocated by the volume (but were considered free by the filesystem) for any purpose other that storing data. For all intents and purposes, the filesystems 'free' blocks were indistinguishable from valid data that needed to be protected.

      Thus begat the rise of over-provisioning. Thats 120GB SSD was probably a 128GB SSD pretending to only be able to store 120GB, leaving 8GB as a pool of 'ready to be written to' blocks of data.

      However as TRIM support began ramping up, it was now possible for the filesystem to inform the SSD that some of the logical volume was unimportant and could also be used as a pool of 'ready to be written to' blocks of data. Thus begat the rise of power-of-two SSD's whos performance didnt rapidly begin to suck.

      Over-provisioning is still recommended if there is any chance of nearly filling the SSD, but is now completely irrelevant in the case of sparsely populated logical volumes. So now modern SSD's also have a configurable amount of over-provisioning with (typically) a quite small amount of default over-provisioning.

      TL;DR: Without TRIM, the SSD must consider your entire logical partition (free space and all) as valid data that needs to be maintained. With TRIM, the SSD can be informed as to which space is free, thus it does not need to maintain the integrity of the data that is there.

      --
      "His name was James Damore."
  9. Re: "Good news for hardware enthusiasts!"... by Gadget_Guy · · Score: 4, Insightful

    ...or typesetters & typists, accountants, video editors, music composers, engineers & architects, etc. In fact, anyone who produces, rather than consumes will tend to use computers as their main system. SSDs work nicely for all of them, if only to store the OS and program files.

    That you only know gamers and developers says more about the company you keep rather than what technology is used out there. It is true that tablets and smart phone sales are on the rise and PC sales are declining, but that doesn't mean that people have stopped using their old computers.

  10. Out-of-the-box? by rossdee · · Score: 4, Informative

    Does Linux come in a box these days, I thought you just downloaded it, and didn't have to pay for it and the packaging...

  11. Ubuntu != Linux by Anonymous Coward · · Score: 4, Informative

    It's been in the kernel for a long time now, google tells me since 2.6.33 (Which was released early 2010, about a half a year after Windows 7 was released). Ubuntu 12.04 (The last LTS) shipped with 3.2, so you could already enable TRIM using 12.04. This announcement is nothing more then a default settings change, I have no idea why it's even a big deal (Or why this wasn't already the default, I've been using it for a while now).

  12. Re:Simplicity? by profplump · · Score: 2

    I don't understand what's scarier about this:
    lvextend -L+6G /dev/foo/bar
    than this:
    vmkfstools -X 6G /vmfs/volumes/foo/bar.vmdk

    But that wasn't really the the question I was asking -- what's the different between file-system snapshots and LVM-snapshots (other than filesystem-snapshots obviously don't allow changes to the filesystem itself, which most people don't care about most of the time). Is there something that makes tasks like backups or upgrades easier or faster? Is there some other task I'd snapshot for that just isn't possible with LVM?

    There are lots of reasons to like newer filesystems, but the +4 poster above specifically said the LVM snapshots were not as useful as filesystem snapshots, and I'm just wondering what I'm missing.