I want to mount a drive with a specific label automatically everytime it gets pugged-in. I do not want to use any other tool than
systemd as other units depend on the mount and must be started automatically.
What I have got so far:
[Unit] Description=the camera SDCard StopWhenUnneeded=true Before=copy-camera.service [Mount] What=LABEL=CAMERA Where=/mount/camera Type=vfat [Install] WantedBy=multi-user.target
[Unit] Description=camera SDCard [Automount] Where=/mount/camera [Install] WantedBy=multi-user.target
This does successfully mount the drive if I
cd into the mountpoint. However I want the drive to be mounted just because I insert it because there is a service that is started by the mount unit.
Is it possible to achieve this using systemd? If yes: How?
If it is impossible: is there a way I could do it with very few extra steps?
I know that I could add a timer that
cds into the mountpoint every x seconds - but this is note really elegant, is it?