For a couple of years, I've been using a udev rule (inspired by a post on the German debian forum - https://debianforum.de/forum/viewtopic. ... 0#p1002121 ) and a script on my Odroid-XU (headless Debian8) to do the following things when a USB drive is connected:
*create a directory called <partition label> in /media unless it already exists
*mount the partition there
*share it via NFS and CIFS
This works like a charm. In theory, this mechanism is also supposed to clean up on removal of the drive, however, that doesn't work so well ... (different story)
I'm trying to move all servers to my brand new N2 (running @tobetter's Ubuntu 20.04). So I tried to use my udev rule and script there as well which only sort of works:
Drives are mounted, but then something umounts them almost immediately.
At first I thought that there's something wrong with my udev rule or my script, so I put an additional line at the script's end
Code: Select all
mount > /tmp/mountlog
I'd appreciate any input because I'm out of ideas.