Hazard's stuff

02 Feb, 2014

Fix for Fedora USB disks going into /run/media/[user]

— Posted by hazard @ 14-02-02 17:27
As part of systemd/DBus revolution, newer Fedoras have this annoying feature that all USB disks get mounted into to /run/media/[user]/[diskname] (also /var/run/media, which is a symlink).

After some digging, I found that this is done supposedly for security reasons and being taken care of by udisks2 daemon. I'm still not sure what extra security this gives since 99% of Fedora desktops are not accessed by untrusted users, while admins of untrusted multiuser machines usually understand the risks. Nevermind. What I'm sure though, is that it breaks guest access to USB disks from Samba and breakes old scripts which were using /media.

To return old behavior back and make udisks2 change mount point to /media, create a file /etc/udev/rules.d99-usb-shared-media.rules:

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

udev should notice and read this file automatically. After this, just unplug and plug your USB drive back to see it in good old /media.

Comments

Hazard's stuff is maintained by Vladimir Ivashchenko <hazard -at- hazardous-area.org>
This blog is powered by pLog