How to automatically mount an USB device on plugin-time on an already running system?
I know how to use
/etc/fstabto automatically mount devices on boot or when doing
sudo mount -a, which works perfectly fine. For example, here is my current line for my device
UUID=B864-497A /media/usbstick vfat defaults,users,noatime,nodiratime,umask=000 0 0
How do I achieve automatic mounting when this USB device with known UUID is plugged in while the system is already running, so that I don't have to run
sudo mount -aafter it is plugged in?
Additional info: I'm working on an up-to-date console-only Debian wheezy linux.
By `How do I achieve automatic mounting when this USB device with known UUID is plugged in` do you mean you *only* want to automount this specific USB drive? Or does it matter? I've gone ahead an posted a more generic answer that will automatically mount most USB storage devices, but I am not entirely sure this is what you want.
sudo apt-get install usbmount
usbmountwill automount hfsplus, vfat, and ext (2, 3, and 4) file systems. You can configure it to mount more/different file systems in
/etc/usbmount/usbmount.conf. By default it mounts these file systems with the
sync,noexec,nodev,noatime,nodiratimeoptions, however this can also be changed in the aforementioned configuration file.
usbmountalso supports custom mount options for different file system types and custom mountpoints.
after installing this it did start auto-mounting drives again but I don't seem to have access rights as my user, making it needlessly painful to copy files. Would you expect I'd have to edit the config mentioned to achieve this or is it likely to be something else? My machine has just been crippled by some updates - i had to shutdown on the command line previously but now it wont work with my usb... also just lost my graphics drivers so my desktop looks like windows 3.1 or something! :( not been a good week for my computer
@Jonny You didn't mention what distribution you were running but if it has a GUI it should auto-mount drives by default. It sounds like what you are experiencing is part of a bigger, different problem; especially if other things started behaving oddly too.
yeah possibly. I've been neglecting it for a while. I'm on debian using xfce. I might post a question on here
I tried this myself, only to find that it doesn't support NTFS well (or really, at all), so I formatted my disk as VFAT and all is well now.
Is there a way to force `usbmount` to use volume lables as mount points rather than `usb1`, `usb2`, `usb3`...?