Ubuntu – Does upgrading a kernel automatically enable trim

kerneltrim

Simple question, I have some servers that were running 10.04 that I upgraded to 12.04.

So they were installed using 10.04 (kernel 2.6.32* I believe) and the version of ext4 that shipped then.

By upgrading to 12.04 and the newer kernel, does that enable TRIM automatically? (Do I need to add 'discard' to the fstab?)
Or do I need to do a clean install of 12.04 to get TRIM functionality on those drives.

Best Answer

No, upgrading a kernel does not turn it on automatically - it's still off by default for the kernel shipped with 12.04.

Please refer to the manpage of mount:

discard/nodiscard
  Controls whether ext4 should issue discard/TRIM commands to  the
  underlying  block  device when blocks are freed.  This is useful
  for SSD devices and sparse/thinly-provisioned LUNs,  but  it  is |
  off by default until sufficient testing has been done.           | <--