Installer didn't enable TRIM on my new ssd...

So I put a fresh install of 14.3R on a thinkpad X220 I just got hold of. After setting everything up I went through and checked the sata drive attributes with tunefs, and noticed the trim flag was off. I installed using the standard installer, chose UFS with soft updates and journalling, using the "guided" partition scheme.

So I rebooted into single user mode and enabled trim on the drive using tunefs (tunefs -f enable ...). I then did a manual 'fsck-ufs -E' to trim the drive up to that point, ie resulting from the install. This seems an easy one to miss when installing a machine especially as ssd's are so commonly used nowadays. If you're running on a sata ssd it's worth being aware of this, I don't know what happens with nvme.

I guess the installer doesn't know whether you're installing on an ssd or spinning rust... maybe some future version of the installer could ask the user whether they want to enable TRIM on the drive or not, but perhaps it's not so straightforward...
 
My routine for installing on SSD is Auto Partition but then go back and delete root partition and swap. Then I recreate root partition to fill all space.
Notice when re-creating a partition you have "Options" button in middle. Here is the Trim setting.
You must manually create partitions for this Options dialog button. Previous versions this was available with Auto Partition but that has been lost.
 
Ahhh... ! Interesting, some history I wasn't aware of. I wondered too if they might have left it out of the installer because a lot of drives don't work properly with trim, the linux kernel has a long blacklist of them. Whether it works properly on my generic chinese ssd, who knows; well, the drive thinks it supports it, anyway!

So the trick is not to use auto-partitioning, partition manually, then you get an options dialog and can set trim on in there.
 
Back
Top