To check, depends on which device you’re interested in:
cat /sys/block/<device>/queue/scheduler
So for example,
$ cat /sys/block/sda/queue/scheduler
$ [mq-deadline] kyber bfq none
My SSD (/dev/sda, Samsung EVO) is using the multiqueue deadline scheduler (mq-deadline), which I believe is the default out of the box, because my un-edited 60-ioscheduler.rules file looks like so:
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline"
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="bfq-sq"
You can make a backup of the file /etc/udev/rules.d/60-ioscheduler.rules, and then modify it to override the scheduler based on a new rule.
EDIT: If you override a scheduler, make sure to use the exact name as shown in the supported schedulers. For example, if you change the scheduler to use magical-berries, the kernel will fallback to the default for that device, such as mq-deadline.
That’s odd, since discard can put more stress on the SSD to constantly trim on-the-fly. I think it’s safer to leave discard/nodiscard omitted from the fstab entry, and simply rely on the default weekly fstrim timer.
To make sure the timer is active:
systemctl status fstrim.timer
To make sure the service is being triggered by the above weekly timer:
systemctl status fstrim.service
Otherwise, unmask, enable, and start the timer:
systemctl unmask fstrim.timer
systemctl enable fstrim.timer
systemctl start fstrim.timer