fstrim command and LUKS ?

Hi there,
I have to admit, never cared much or read about fstrim and SSDs…

I have / on a LUKS encrypted nvme device. /home/ is on a mechanical hdd.

So I thought the root system / could be used with fstrim.

Now I tried to use fstrim with --dry-run just to see what fstrim would do.

# fstrim -A -v --dry-run
/mnt/windows: 0 B (dry run) trimmed on /dev/nvme0n1p3
/boot/efi: 0 B (dry run) trimmed on /dev/nvme0n1p1
/boot: 0 B (dry run) trimmed on /dev/nvme0n1p4

As you can see, fstrim does not touch the root file system** /** it completely skipped /

This makes me wonder, does fstrim automatically skip LUKS devices?
Should LUKS encrypted SSD (nvme in my case) not get trimmed?

One other thing that caught my eyes is, that systemd fstrim.timer is disabled on my system, I never touched fstrim.timer.

How do you handle your LUKS SSDs? Do you trim?

Discard is disabled by default on LUKS devices; you need to open it with --allow-discard option or used “discard” option in /etc/crypttab.

Does discard need only be set in crypttab or in fstab as well?

“discard” in crypttab enables discard processing on device. “discard” in fstab tells filesystem to perform them automatically (if supported by filesystem). Without the former no discards are possible, neither automatic nor manual. Whether you want the latter is entirely up to you. I think automatic discards are redundant and doing them periodically makes more sense (assuming you actually need discards at all).

My only concern for using discard at all is SSD/NVME life expectancy, I read it should improve it.

I guess trimming in a mechanical hard drive is not necessary at all?

When doing lsblk --discard I was surprised to see, trimming is also available to the mechanical HDD… But if I understand discard correctly, it makes no sense in a mechanical hdd.