[HowTo] Exclude or ignore Btrfs from fstrim service when using Kernel 6.2+

There are two possible ways to determine if your SSD supports Trim/Discard

$ lsblk --discard

If DISC-GRAN and DISC-MAX are not 0, that means your SSD supports it.

$ sudo fstrim --all --dry-run --verbose

It automatically detects if your SSD and some official filesystem support it.


Note

If you use encryption LUKS on your SSD, but Trim/Discard is disabled for LUKS by default.
You can manually enable it.

For internal SSD:

For any external SSD via USB:

1 Like