polkit stops access to USB drives

Karl Auer kauer at biplane.com.au
Sat Oct 3 04:51:03 UTC 2020


The following describes a situation that happens, but seems to go away
when my system is power cycled (gracefully of course). Obviously I
would prefer not to have to reboot everything if there is a better way
to recover. Even better would be to find out how to avoid this!

So not a big problem, but a significant irritant.

Out of the blue, after working fine for hours or days and plugging and
unplugging USB drives without any issues, I get this error when I
connect a USB drive:

<some message>

Not authorized to perform operation (polkit authority not available and
caller is not uid 0) (udisks-error-quark, 3)

Once this happens, I cannot (as me, ordinary user) in any way access a
USB drive. The error is always as above, but "<some message>" changes -
"Unable to delete partition", "Unable to access <volume>", "Unable to
eject <volume>" or whatever it may be.

syslog shows that the drive was detected as a USB device, but was not
able to be mounted (although Nautilus shows it as mounted) and there is
no ephemeral entry in /media/kauer as there normally would be:

Oct  3 14:10:23 kt1 kernel: [241700.465731] sd 6:0:0:0: [sdb] Attached SCSI removable disk
Oct  3 14:10:24 kt1 gnome-shell[2866]: Unable to mount volume ABC_USB_C2: Gio.IO ErrorEnum: Not authorized to perform operation (polkit authority not available and caller is not uid 0

I *can* mount USB drives manually as root:

kauer at kt1:~$ sudo mount /dev/sdb1 /mnt/misc
kauer at kt1:~$ ls /mnt/misc
 AUTOEXEC.BAT   DISPLAY.SYS    LABEL.EXE        rufus.ini
[..etc..]

But then I can only access them as root, of course:

kauer at kt1:~$ cd /mnt/misc
kauer at kt1:/mnt/misc$ touch blah
touch: cannot touch 'blah': Permission denied

pkaction shows this:

kauer at kt1:~$ pkaction | grep mount
org.freedesktop.udisks2.filesystem-mount
org.freedesktop.udisks2.filesystem-mount-other-seat
org.freedesktop.udisks2.filesystem-mount-system
org.freedesktop.udisks2.filesystem-unmount-others

... and that list and the contents of those stanzas (as given by
pkaction --verbose) is the same as on another Ubuntu 20.04 system.

polkit is running:

kauer at kt1:~$ sudo systemctl status polkit.service
[sudo] password for kauer: 
● polkit.service - Authorization Manager
     Loaded: loaded (/lib/systemd/system/polkit.service; static; vendor preset: enabled)
     Active: active (running) since Mon 2020-09-28 23:11:00 AEST; 4 days ago

Anyone have a clue as to what is changing on my running system?

There are a few things I have not yet tried, but will try the next time
this happens, such as restarting the polkit service or seeing if a
reboot or logout is enough to recover things rather than a full power
cycle.

Regards, K.

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer at biplane.com.au)
http://www.biplane.com.au/kauer

GPG fingerprint: 2561 E9EC D868 E73C 8AF1 49CF EE50 4B1D CCA1 5170
Old fingerprint: 8D08 9CAA 649A AFEF E862 062A 2E97 42D4 A2A0 616D







More information about the ubuntu-users mailing list