I run Lubuntu 14.04 (without a display manager). When I connect a USB disk it is not automatically mounted and it doesn't show up in the file manager PCManFM. What daemon do I need to run to enable automatic mounting of USB disks?
2 Answers
The following two steps are required:
Start the window manager with
dbus-launch
in~/.xinitrc
:exec dbus-launch --exit-with-session <your-wm>
This makes the disks show up in PCManFM.
Add a file named (e.g.)
udisks.pkla
to/etc/polkit-1/localauthority/50-local.d/
with the content:[Allow mounting removable media] Identity=unix-group:plugdev Action=org.freedesktop.udisks2.filesystem-mount ResultActive=yes ResultInactive=yes ResultAny=yes
Though this also allows unmounting of removable media I still get a (false) error message from PCManFM saying "Not authorized to perform operation".
In addition to August's answer, the following. When rightclicking on the mounted removable media in pcmanfm serveral actions to choose from show up. Two of those are Umount Volume and Eject Removable media. When Unmount Volume is chosen the volume will be unmounted without warning. If on the other hand Eject Removable media is chosen, the volume will be unmounted but not ejected and a "Not authorized to perform operation" message will appear. For permission to eject the media, another rule has to be added to /etc/polkit-1/localautority/50-local.d
. In this directory create a file called udisks.drive-eject.pkla and add the following code to it:
[Allow ejecting removable media]
Identity=unix-group:plugdev
Action=org.freedesktop.udisks2.eject-media
ResultActive=yes
ResultInactive=yes
ResultAny=yes
Now the removable media is ejectable. There will be no more warnings. Leftclicking on the mounted removable media in pcmanfm tells pcmanfm to eject the media, hence the warning before adding the second rule.
sleep 5s && udisksctl mount -b /dev/sdb1
in my autostart wheresdb1
is my USB disk.dbus-launch
the icons for removable media show up in PCManFM. However, when I try to access/mount such a disk I get the error message "Not authorized to perform operation." Any clues?