SD card sometimes stays "mounted" after shutdown

For storage which is always there (such as SATA…not hot pluggable) you’d configure in “/etc/fstab”. For automount of hotplug storage (like SD card) you need a udev rule, not an fstab entry. You’ll probably want to examine the files in “/etc/udev/rules.d/”, as this is where udev customization goes. You’ll likely end up writing a file there with a name such as “99-custom-sd-mount.rules”.