13

The situation with TRIM in Ubuntu has me utterly confused. I don't know whether I need to manually run it or not. Sources I've found are disparate and unclear.

I have Ubuntu 10.04 with latest updates (including kernel 2.6.32-26). I have an Intel X-25M drive with latest firmware, and it is formatted as ext4.

So, does TRIM support run automatically? If not, how do I check if I need to run it, and then how do I run it if necessary?

1
  • Note that the physical disk itself must also support TRIM - some of the older disks don't; not sure about your model. Mar 8, 2012 at 12:28

5 Answers 5

13

According to this bug report TRIM is not supported with the Ubuntu kernel in Ubuntu Lucid (10.04).

All newer versions of Ubuntu come with a kernel which supports TRIM but you will have to manually activate it if you are using the ext4 file system (default).

4
  • The bug reports mentions back porting trim support from 2.6.33, we're now at 2.6.35. The bug report concerns version 2.6.32 Nov 26, 2010 at 10:04
  • 1
    The question is about 2.6.32, the bug report applies to the question ;) Nov 26, 2010 at 10:07
  • Of course, I apologise. I just assumed that 10.04 had the latest one (why would it?). I'll read more carefully next time. Edited my answer to make sense now. :) Nov 26, 2010 at 10:23
  • Well, the word "current" is still misleading, since current kernels definitely support TRIM, I'll edit the answer accordingly.
    – Uli
    Mar 8, 2012 at 9:50
7

The Linux kernel supports TRIM as of version 2.6.33.

So the answer is: Yes, Linux, in it's latest version, supports TRIM out of the box. Ubuntu 10.04 doesn't though.

The question is whether the feature will be back ported to 2.6.32 or 10.04 will get an update to 2.6.33+. (see João Pinto's answer)

Of course your SSD has to support it as well. There are also still some issues with some specific SSDs (I think the Indilinx ones may still be a bit wonky for example). The SSDs firmware has to implement everything properly - but, I understand, some SSDs implement TRIM in a way that isn't really conform with the ATA standard. Or at least in a buggy way.

The first generation X-25M from Intel doesn't support trim "Properly" (or not at all - strictly speaking). The second generation Intel X-25M G2 does. I don't know whether the latest firmware adds proper TRIM, the Intel website keeps mentioning it's "Optimised for Windows 7", which could mean it's bolted on as a software feature in the windows driver, and that the disk doesn't do it on it's own because Intel left their homework on the bus again :-)

1
5

TRIM support was introduced in Linux 2.6.33 (Ubuntu 10.10), however it is unlikely that Ubuntu 10.04 will ever receive TRIM support. Once acquired, TRIM support must be activated through FSTab.

5

I see the following pieces in the description of 2.6.32-39 update:

  • sata_mv: fix broken DSM/TRIM support (v2)

    • LP: #644694
  • ext4: make trim/discard optional (and off by default)

I assume this means that it is now supported.

1

It looks like this went in Ubuntu-2.6.32-9.13 as commit 9f3979ef, back in Dec of 2009, so has been available in lucid since it was released.

You do of course, need to mount with the discard option to enable it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .