2

Not sure if I properly unterstand they way TRIM on SSD is supposed to work. According to lspci I've got the following device: Samsung Electronics Co Ltd NVMe SSD Controller SM981/PM981. It shows up as nvme0 in /dev. In Ubuntu 19.04 standard configuration, systemd regulary runs fstrim -Av by systemd fstrim.service. According to this commands output it only trims /boot/efi and /boot, but not my other filesystems and partitions.

According to documentation I found, fstrim is only possible if hdparm -I lists TRIM as a capability of the disk. This just fails with "Inappropriate ioctl for device" and doesn't list any capabilities at all.

I guess something is broken here?

This happens on Ubuntu 19.04 with latest upgrades applied. The filesystems that are supposed to be trim'ed are on a partition in nvme0, which is setup as LUKS device, which in turn contains an LVM PV with various logical volumes.

  • you may find this reference of help in understand TRIM: howtogeek.com/176978/… – Graham Jul 27 '19 at 9:34
  • Thanks. Have already seen this article. It suggests to run fstrim, which is exactly what is not working on my system. I've also seen other articles suggesting this. That's why I'm asking here - everyone suggest to run fstrim, but there seem to be some scenarios where this doesn't work. – Thomas Jul 27 '19 at 9:39
  • You also have to enable discard for LVM and the LUKS layer like described in 1. and 2. from blog.neutrino.es/2013/… – Thomas Jul 27 '19 at 10:13
1

Thanks! Adding discard to crypttab did indeed help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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