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.

When I reinstalled Ubuntu 12.10 64-bit on my SSD, I chose the option to use LVM in Ubiquity. I am trying to find out how to enable TRIM for my SSD. I came across this article:

http://worldsmostsecret.blogspot.com/2012/04/how-to-activate-trim-on-luks-encrypted.html

The article states in addition to adding discard and noatime to /etc/fstab , discard must be added to the drive (sdX_crypt) in /etc/crypttab. My problem is the only listings in my /etc/crypttab are several cryptswap; it does not list any sdX_crypt.

I currently have a /dev/sda1 (ext2), which is the boot point, and /dev/mapper/ubuntu-root, which is my ext4 partition.

Any ideas as to how to enable TRIM?

share|improve this question
add comment

1 Answer

Crypttab could only be relevant if you were actually using LUKS, which you haven't mentioned. ("As long as LUKS is not aware that you want to use TRIM it will effectively block all TRIM operations coming from the LVM partition's file system, for security reasons")

If you're not using LUKS, it will be sufficient to add the discard option to fstab.

Be aware what you're doing. This would start sending TRIM commands when deleting files on those filesystems. To TRIM previously deleted files, I believe you will need to run the fstrim command.

You should also be aware of the "issue_discard" option in /etc/lvm/lvm.conf. This controls whether TRIM is sent when LVs are shrunk or deleted. (Again, it doesn't say anything about TRIMing space which is already free). It's disabled by default. Personally I would leave it that way, because I'm used to the possibilities of recovering from errors. (And when I'm happy, I can use fstrim on the filesystem I've created... I suspect swap partitions are still issuing trim by default though).

share|improve this answer
add comment

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.