245 字
1 分钟
Ubuntu 挂载U盘失败
2022-02-13

前言#

今天遇到了个非常坑的问题:Ubuntu 下挂载U盘失败。

这个U盘我用了有一段时间的从 Ubuntu 18.04 到 20.04 ,用了大约有2年了,今天突然告诉我挂载失败…

我的系统:Ubuntu 20.04.3 LTS

报错信息#

不能访问”SX1 16G” Not authorized to preform operation (polkit authority not available and caller is not uid 0)

看报错信息应该是权限上的问题,还不到U盘损坏的地步。

解决方法#

找到对应的文件,修改如下文件1

Terminal window
sudo vim /usr/share/polkit-1/actions/org.freedesktop.UDisks2.policy

找到 action-id 是 org.freedesktop.udisks2.filesystem-mount 的 <action> 标签,中间应该会有一大段不同语种的 <description><message> 标签,不用管。

找到对应的 <default> 标签,将 auth_admin 改为 yes 即可:

<action id="org.freedesktop.udisks2.filesystem-mount">
<description>Mount a filesystem</description>
<description xml:lang="zh_CN">挂载文件系统</description>
...
<message>Authentication is required to mount the filesystem</message>
<message xml:lang="zh_CN">挂载文件系统需要身份验证</message>
...
<defaults>
<allow_any>yes</allow_any> <!-- <allow_any>auth_admin</allow_any> -->
<allow_inactive>yes</allow_inactive> <!-- <allow_inactive>auth_admin</allow_inactive> -->
<allow_active>yes</allow_active>
</defaults>
</action>

Footnotes#

  1. 解决linux挂载U盘时 authorized to perform operation

Ubuntu 挂载U盘失败
https://fuwari.vercel.app/posts/ubuntu/ubuntu-挂载u盘失败/
作者
Asuwee
发布于
2022-02-13
许可协议
CC BY-NC-SA 4.0