Mount only specific USB stick

2

I am trying to configure a Linux (Ubuntu 14.10) so that it will only mount a specific USB stick from one specific USB port.

Can someone point me into the right direction on how to do this?

Thanks

evermean

Posted 2015-04-17T11:13:59.133

Reputation: 143

Answers

2

The /etc/udev/local.rules file on my system looks like:

...
# Media automounting
SUBSYSTEM=="block", ACTION=="add"    RUN+="/etc/udev/scripts/mount.sh"
SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh"
...

I suppose you have something similar.

If you need to allow automount of a single specific USB stick (or a limited number of known sticks), you can add ATTRS{serial}=="SERIAL" to the add rule, repeating it for each stick you want to automount.

If a more advanced logic is necessary, you could modify the /etc/udev/scripts/mount.sh script itself. I use it to specify specific mount options to some of the partitions on my removable drives.

Dmitry Grigoryev

Posted 2015-04-17T11:13:59.133

Reputation: 7 505