Automounting an attached USB partition in debian 12 minimal

Just a heads up that the partition got corrupted soon after I started using this. I put the laptop to sleep without unmounting the partition first; when I resumed the laptop, all the files on the partition (ext4) were gone (it was bad enough that utilities like fsck couldn’t fix it using the superblock backups; photorec could recover the files, but testdisk couldn’t recover the directory structure). I’m not sure if it’s related to the systemd automounting configuration, or just a shitty coincidence. It’s possibly related to: Implement facilities for handling unexpected physical removal of block devices · Issue #1082 · QubesOS/qubes-issues · GitHub . Currently discussing alternatives at Having to re-attach USB drive partitions after waking laptop from sleep .