Mount USB drive as regular user in Ubuntu

Published: October 20, 2022

Mount USB drive as regular user in Ubuntu

In previous article, we covered how to Manually mount a USB drive in Ubuntu, which could only be done by a user who has access to superuser privileges. But, what about regular users then? A regular user can also mount/unmount USB drives.

Although, in that case we still need superuser privileges to install the relevant package. But, after that a regular user could be able to manually mount or unmount USB drives as and when required.

The command-line utility which we use is pmount. And, the package we install also goes by that name.

So, we cover the installation steps first.

Install pmount in Ubuntu

Installation is pretty straight forward. The package is available through standard Ubuntu repository. Update the repository first. Hence, open a terminal and issue the following -

sudo apt update

Next, to install pmount -

sudo apt install pmount

To verify the installation -

pmount --version

It would show us the installed version.

Mount USB drive as regular user in Ubuntu through pmount

First, we would have to identify the device name of our USB drive. Use lsblk command-line utility -

lsblk

It would list information about all block devices. To know more about lsblk in Ubuntu. For us, the device was -

└─sdc1 8:33 1 7.5G 0 part

So, the device name is /dev/sdb1. Now, use the following syntax to mount the USB drive -

pmount <device_name> <mountpoint_label>

Continuing with the above example, it would be -

pmount /dev/sdb1 myUSB

What <mountpoint_label> does is, it creates a directory in /media/ with label as the directory name. So, for above - our USB drive would mount at /media/myUSB.

Unmount USB drive as regular user in Ubuntu through pumount

Use the pumount command-line utility to unmount the USB drive -

pumount <device_name>

For instance,

pumount /dev/sdb1

Once we unmount the USB drive, the directory we created through label i.e. /media/myUSB also vanishes.

In conclusion, we have covered how to mount USB drive as regular user in Ubuntu through pmount.