Change mountpoint of USB drives

Change mountpoint of USB drives

From Ubuntu 13.04 onwards you can tell udisks2 to automount in /media/ instead of /media/[username]/ by adding a udev rule that sets the environment var UDISKS_FILESYSTEM_SHARED. You can do this by adding a file called (eg) /etc/udev/rules.d/99-udisks2.rules that contains:

ENV{ID_FS_USAGE}=="filesystem", ENV{UDISKS_FILESYSTEM_SHARED}="1"

I think udev monitors the /etc/udev/rules.d folder to detect changes, but if not, you can force it to reload its rules with sudo udevadm control --reload. Note though that the new mount location doesn't seem to take effect until you physically remove and plug the external drive back in.


For your convenience, you can paste the following into the terminal

sudo nano /etc/udev/rules.d/99-udisks2.rules


enter this text in the file:


ENV{ID_FS_USAGE}=="filesystem", ENV{UDISKS_FILESYSTEM_SHARED}="1"


and safe the file (CTRL X)

Now anyone accessing your machine can access the removable disks you plug into it. So be careful. Tested on 18.04, and 20.04 but as pointed out above, it should work on 13.04 and later.