0

I currently have a little SSD (32 GB) for / and another HDD (250 GB) for /home where I use eCryptfs to encrypt my personal files. I consider buying a big SSD (500 GB) to have all the data on a SSD as well. With the Kubuntu installer, I found the “guided with encrypted LVM” pretty satisfying, I am just not sure whether this would enable TRIM on the SSD.

This seems to pose a bit of a risk, but I assume that the performance will turn bad pretty quickly if I do not use TRIM.

  1. Does the installer automatically enable TRIM?
  2. If not, how could I enable it after the installation?

1 Answers1

0

Will “guided with encrypted LVM” enable TRIM on a SSD?

No. Trim is installed by the installer though but the 2 have no correlation. Trim is enabled based on the brand of your SSD. If the SSD is supported and tested prior and deemded working perfectly trim will be enabled. Otherwise it will be installed and disabled and you need to enable it manually. This is independent of the installer.

So one installation might have you a working trim from the start; another installation might have you needing to enable it manually.

If not, how could I enable it after the installation?

From fstrim:

5555            if ! contains "$HDPARM" "Intel" && \
5656               ! contains "$HDPARM" "INTEL" && \
5757               ! contains "$HDPARM" "Samsung" && \
58                ! contains "$HDPARM" "SAMSUNG"; then
59                 echo "device $DEV is not an Intel or Samsung drive"
 58               ! contains "$HDPARM" "SAMSUNG" && \
 59               ! contains "$HDPARM" "OCZ" && \
 60               ! contains "$HDPARM" "SanDisk" && \
 61               ! contains "$HDPARM" "Patriot"; then
 62                echo "device $DEV is not a drive that is known-safe for trimming"
6063                continue
6164            fi
6265        fi

How is Trim enabled?

Rinzwind
  • 299,756
  • I saw that there is no discard in my /etc/fstab although it is installed on an SSD. mount does not show any discard either. Does that mean the OCZ Nocti does not support TRIM in Ubuntu? – Martin Ueding Oct 07 '14 at 07:21
  • No. discard will give a bad performance hit. See the answer in the link. Ubuntu opted for a weekly cron job. – Rinzwind Oct 07 '14 at 07:23
  • I just finished reading your answer in the link. Makes sense. Since OCZ is not Intel or Samsung, the cron job will probably not do anything, then. Still I think I need to do a bit more to get it through LVM and LUKS by setting the appropriate options in the crypttab, right? – Martin Ueding Oct 07 '14 at 07:26
  • @queueoverflow as of 14.04 OCZ is also automatically going to be enabled. – Rinzwind Oct 07 '14 at 15:22
  • see http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/util-linux/trusty/revision/103#debian/fstrim-all – Rinzwind Oct 07 '14 at 17:31
  • Your copy of code from fstrim seems to contain the deleted lines (unindented 58 and 59) in the changeset you reference. I suppose it's not what you meant to paste. – Ruslan Jan 12 '18 at 14:21