Search code examples
mountarchlinuxudisks

Udisk - Error creating mount point no such file or directory


I'm trying to automatically mount a USB drive on linux. With all default settings it works and the drive is mounted to /run/media/username/drivename.

I tried to change the default mount point to /media/drivename by following the guide linked here: https://wiki.archlinux.org/index.php/Udisks#Mount_to_/media_(udisks2)

I added the file /etc/udev/rules.d/99-udisks2.rules with the following contents:

# UDISKS_FILESYSTEM_SHARED
# ==1: mount filesystem to a shared directory (/media/VolumeName)
# ==0: mount filesystem to a private directory (/run/media/$USER/VolumeName)
# See udisks(8)
ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{UDISKS_FILESYSTEM_SHARED}="1"

I then rebooted my machine. Now every time I try to access the drive, I get the following error:

Unable to mount drivename

Error creating mount point '/media/drivename': No such file or directory

If I remove the file I created and reboot again, the drives are mounted to /run/media/username/drivename like normal, and I can access them fine.

I'm on Arch linux. Any help is appreciated! Thanks!


Solution

  • For anyone running into a similar issue, I simply created the /media folder and then rebooted and everything worked. Apparently udisks expected /media to already exist.

    1. Put 99-udisks2.rules in /etc/udev/rules.d/
    2. run mkdir /media (as sudo)
    3. run reboot
    4. Profit!