SD card sometimes stays "mounted" after shutdown

Couldn’t find anything on line about this, our system requires an SD card to be plugged in at all times. After shutdown it occasionally remains there so when the system boots back up it mounts the card in a new location. For example if the SD card is called STORAGE, sometimes it will come back online as STORAGE1. I can delete STORAGE and still use STORAGE1 but I would prefer if it was still in the same location. It is annoying to have to remove the device and reboot the system because our program outputs to /media/ubuntu/STORAGE/data.

If you know what causes it or how to prevent it I would love some feedback!

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”.