Linux – Cannot mount a USB pendrive

linuxmountusb-flash-drive

I have no problem to mount the USB pendrive from file browsers (Nemo, Nautilus, Dolphin, etc). But I have a pendrive, which cannot be mounted from the file browser. The error message is:

Not authorized to perform operation

And I found that it has a harddisk icon instead of removable media icon.

I can mount the pendrive with the root user with "mount" command.

Is there anyway to fix this problem so that pendrive will be recognised as the USB removable media instead of the harddisk?

Best Answer

This problem can have many different origins. The most likely one is that you have a problem with polkit. Do you have a directory called /etc/polkit-1/localauthority? If so, edit, as root, this file: /etc/polkit-1/localauthority/50-local.d/55-storage.pkla and add the following lines:

  [Storage Permissions]
  Identity=unix-group:plugdev
  Action=org.freedesktop.udisks.filesystem-mount;org.freedesktop.udisks.drive-eject;org.freedesktop.udisks.drive-detach;org.freedesktop.udisks.luks-unlock;org.freedesktop.udisks.inhibit-polling;org.freedesktop.udisks.drive-set-spindown
  ResultAny=yes
  ResultActive=yes
  ResultInactive=no  

You should also add yourself to the plugdev group,

 usermod -a -G plugdev <your username>

which is the correct command for Debian-family distros (Debian, Ubuntu, Mint,...), if you are not on one of those please adapt it to your distro.

If this does not apply, please report back.