Ubuntu – Automatic mounting in /run/media instead of /media

mountudevudisks

When I (manually) mount my crypted document partition on ubuntu 19/04, it is mounted on /media. When I'm in Fedora, it's mounted on /run/media.

I would like udisks2 to mount it on /run/media, as it should be, so I made a udev rules like this :

# cat /etc/udev/rules.d/99-udisk2.rules 

# 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}="0"

But, even after reboot, the document parition is still mounted on /media. Can someone help me to mount it on /run/media ?

Best Answer

Well, it is a source building option as mentioned by this commit when it was introduced.

Support mounting in /media for FHS compatibility

Add --enable-fhs-media configure option to mount in /media instead of /run/media, for FHS compliance and backwards compatibility.

Options I could think of:

  • Make a symlink
  • Bind mount
  • Rebuild the package
Related Question