automatic mounting broken (again) in Ubuntu 10.04 - Lucid Lynx
I get this problem each time I do a distro upgrade on my Ubuntu box; mounting external USB harddrives end up in a "Not Authorized" message box. This is -- like it was in Karmic Koala - a policy issue, but fix is slightly different...

When seeing this message, I was wondering how this can come back again, as I have fixed it a long while ago by editing the /usr/share/polkit-1/actions/org.freedesktop.devicekit.disks.policy file (in Karmic Koala) allowing any user — not just the active ones — to mount usb harddrives. But, this file was gone… :(

…if not interested in the intermezzos, just the fix, scroll to the end… :)

However, discovered a new “suspicious” file in the same directory: /usr/share/polkit-1/actions/org.freedesktop.udisks.policy. I opened it with great hopes, and was not disappointed, right at the beginning was this section:


<action id="org.freedesktop.udisks.filesystem-mount"> <description>Mount a device</description> <description xml:lang="da">Montér en enhed</description> <description xml:lang="de">Gerät einhängen</description> <message>Authentication is required to mount the device</message> <message xml:lang="da">Autorisering er påkrævet for at montere et fil system</message> <message xml:lang="de">Zugriffsrechte werden benötigt um das Gerät einzuhängen</message> <defaults> <allow_any>no</allow_any> <allow_inactive>no</allow_inactive> <allow_active>yes</allow_active> < /defaults> < /action>

thought that I simply switch the following values, and that will be it:


      <allow_any>yes</allow_any>
      <allow_inactive>yes</allow_inactive>

well, doing it (and restarting policykit) was a disappointment, I still had these “Not Authorized” messages when plugging my external HDD in (or trying to mount it with Nautilus in my VNC session)…

Anyway, after some time googling I found nothing but some people complaining about the same thing… I tried reinstalling policykit, policykit-gnome, policykit-desktop-privileges, policykit-1, etc. no use.

Finally, this pointed me in the right direction:

locate policykit



/var/lib/dpkg/info/policykit-1.list
/var/lib/dpkg/info/policykit-1.md5sums
/var/lib/dpkg/info/policykit-1.postinst
/var/lib/dpkg/info/policykit-desktop-privileges.list
/var/lib/dpkg/info/policykit-desktop-privileges.md5sums
/var/lib/dpkg/info/policykit-gnome.list
/var/lib/dpkg/info/policykit-gnome.md5sums

let’s see what the desktop privileges package installs:
cat /var/lib/dpkg/info/policykit-desktop-privileges.list


/.
/var
/var/lib
/var/lib/polkit-1
/var/lib/polkit-1/localauthority
/var/lib/polkit-1/localauthority/10-vendor.d
/var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla
/usr
/usr/share
/usr/share/doc
/usr/share/doc/policykit-desktop-privileges
/usr/share/doc/policykit-desktop-privileges/copyright
/usr/share/doc/policykit-desktop-privileges/changelog.gz

ok, eager to see that policy file:
cat /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla


[Mounting, checking, etc. of internal drives]
Identity=unix-group:admin
Action=org.freedesktop.udisks.filesystem-;org.freedesktop.udisks.drive-ata-smart
ResultActive=yes

[Change CPU Frequency scaling]
Identity=unix-group:admin
Action=org.gnome.cpufreqselector
ResultActive=yes

[Setting the clock]
Identity=unix-group:admin
Action=org.gnome.clockapplet.mechanism.*
ResultActive=yes

SOLUTION

ok, the structure and values in the file, especially “ResultActive” looked promising (I must admit, at this point I was too impatient and sleepy, so did not do further readings on the subject), so I just added the following 2 lines after every section in the file:
nano -w /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla (sudo if you’re using your regular user account)


ResultAny=auth_admin
ResultInactive=yes

restarted policykit, and suddenly I could mount from Nautilus again… :)

2 comments
Cd567e38a4811d91289d721566127dd3 Denis   Wed, 27 Oct 2010 13:55:28 +0000
Thanks, man, you saved the day! :-)
7bc02acd8cd864962e6380a732a7ab04 srejbi   Wed, 17 Nov 2010 14:00:18 +0000
unbelievable that this still hits users. just for the record, have you been doing a version upgrade or a minor one?
New Comment







mini_captcha.png