Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
    
Note that the physical disk itself must also support TRIM - some of the older disks don't; not sure about your model. –  Piskvor Mar 8 '12 at 12:28

5 Answers 5

up vote 13 down vote accepted

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).

share|improve this answer
    
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 –  Stefano Palazzo Nov 26 '10 at 10:04
1  
The question is about 2.6.32, the bug report applies to the question ;) –  João Pinto Nov 26 '10 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. :) –  Stefano Palazzo Nov 26 '10 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 '12 at 9:50

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 :-)

share|improve this answer
3  
Even with a kernel and drive which supports TRIM, it has to be activated in fstab (as described here: askubuntu.com/questions/18903/how-to-enable-trim/19480#19480). –  Uli Jan 8 '11 at 20:58

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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.