Enable discard (TRIM) on SSDs while running LVM on LUKS and Btrfs (Arch)

You might’ve followed the guide at my guide on how to install Arch, and would like to enable the Discard command on your shiny SSD, to keep it fresh!

First add discard as a mount-option to your /etc/fstab:
/dev/mapper/lvmvg-rootvol / btrfs rw,relatime,ssd,discard,compress=lzo,space_cache,subvol=root 0 0
/dev/mapper/lvmvg-rootvol /home btrfs rw,relatime,ssd,discard,compress=lzo,space_cache,subvol=home 0 0

Then allow discard-command to go through LVM in /etc/lvm/lvm.conf:
issue_discards = 1

Then enable the fstrim.timer systemctl with:
systemctl enable fstrim.timer

And at last add it to your boot-section in /etc/default/grub:
GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda3:lvm:allow-discards root=/dev/mapper/lvmvg-rootvol rootflags=subvol=root resume=/dev/mapper/lvmvg-swapvol"

Finally regenerate your grub with:
grub-mkconfig -o /boot/grub/grub.cfg

Reboot and you are done! TRIM will now periodically run because of the discard mount-option in /etc/fstab. If you want to trigger a TRIM run manually first time, you can run fstrim -v / as root.