Skip to main content
In this guide, you’ll learn how to grant non-root users the ability to mount and unmount filesystems on Linux. While root or sudo privileges have traditionally been required, desktop environments and modern distributions often auto-mount removable media such as CD-ROMs, USB flash drives, and external disks under a user’s home directory:
For example, if john plugs in a USB drive labeled FlashDrive, it appears at:

Allowing Non-Root Mounts via /etc/fstab

You can configure /etc/fstab to let normal users mount and unmount specific devices without sudo. Modify the mount options field to include one of the following: Example: permitting all users to mount /dev/sdb1 on /mnt/userdrive:
After editing /etc/fstab, you can test the entry without rebooting:

Managing Mounts with systemd

systemd can manage both static mounts and on-demand automounts via unit files in /etc/systemd/system/. Units must be named after the mount point by replacing slashes with hyphens and appending .mount or .automount.

Creating a Mount Unit

  1. Create the file /etc/systemd/system/mnt-external.mount:
  2. Populate it:
The filename mnt-external.mount must exactly match the Where path /mnt/external (slashes → hyphens).
  1. Reload systemd and start the mount:
  2. Check status:
    Sample output:
  3. To auto-mount at boot:

Creating an Automount Unit

An automount unit triggers the mount only when the directory is accessed. You’ll need both the .mount and a corresponding .automount file.
  1. Create /etc/systemd/system/mnt-external.automount:
  2. Add:
  3. Reload, start, and enable:
Now, whenever you ls /mnt/external, systemd will mount the disk automatically.

Watch Video