You can use systemd-mount to mount block devices with a udev rule. Example of auto-mounting the Raspberry Pi Pico derived from the ArchWiki page mentioned by @Metamorphic (note that you need to make /mnt/pico ahead of time:
ACTION=="add", SUBSYSTEMS=="usb", SUBSYSTEM=="block", ENV{ID_FS_USAGE}=="filesystem", ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="0003", RUN+="/usr/bin/logger --tag rpi-pico-mount Mounting what seems to be a Raspberry Pi Pico", RUN+="/usr/bin/systemd-mount --no-block --collect -o gid=users,fmask=113,dmask=002 $devnode /mnt/pico" The post mentions adding the flag --automount=yes, but this caused remount problems for me.
Make sure to reload the udev rules so your changes take effect:
sudo udevadm control --reload Adding the logger message to the rule helped with debugging. You can see it get printed by watching journalctl -k. It's useful to start with a generic match pattern, then build up to something more specific.