Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How do I mount an usb drive on connect?

Hi! I am running a fedora server (Fedora 22) and am looking for a way to automatically mount an usb drive when the drive gets plugged in.

I want to use this to do my backup. The idea is: When I connect the backup usb drive to the server, it gets mounted automatically and the backup program (obnam, probably) gets started to do the backup.

Now I know that gnome disks can set that up for me, but I do not want to install a GUI on a headless server unless it is absolutely necessary. I have looked into systemd's automount feature, but it does not do quite what I want: I want the drive to be mounted (and a program run) when the drive gets connected, not when the first access attempt is made.

Does anyone know how to do this?