TRIM on Samsung NVMe

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.

3

1 Answer

Thanks! Adding discard to crypttab did indeed help.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like