Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 06-05-2014, 07:02 PM   #1
Registered: Apr 2006
Location: Athens, Greece
Distribution: slackware, debian, ubuntu
Posts: 666

Rep: Reputation: 39
mounting usb as user

Hi all,
I am trying to mount a usb as a simple user (who is a member of plugdev group and has inserted the mount command in the sudoers file).

The aim is to mount and umount a usb stick from the command line as a normal user and use it normally (read , modify , create new files etc).

If i type

sudo mount /dev/sdX1 /mnt/usbstick

I will get the device mounted without a problem but it is mounted as root:root and the permissions are 755, so I can not use the stick as expected ( I can not write to it ).

I need to either add the option umask=000 , or set a uid or set gid or a mixture of the above.
These all look somewhat ugly. Is there another way that I may be missing?

thank you for your help.
Old 06-05-2014, 07:21 PM   #2
Registered: Apr 2011
Location: California, USA
Distribution: Slackware
Posts: 528

Rep: Reputation: 273Reputation: 273Reputation: 273

Originally Posted by nass View Post
The aim is to mount and umount a usb stick from the command line as a normal user and use it normally (read , modify , create new files etc).
I have simple operations for USB storage devices. As a user I just plug in one flash drive at a time so I have the following in fstab. I created a directory /mnt/flash.

/dev/sdc1   /mnt/flash   auto   noauto,users   0 0
As a normal user I plug in the flash drive and type "mount /mnt/flash".

The option "users" allows a normal user to mount and any user to umount. You could also use "user" without the trailing 's' to restrict umount to only the user that mounted the device.

Occasionally I have to run as root to umount something when I unplug the flash drive without unmounting it first.

Most users want all of this to happen automatically no matter which device (/dev/sdxx) is used. Others on this forum would have to help with the automatic stuff (Which I turn off in Xfce).

EDIT: I ran "fdisk -l" (L) as root after plugging in the flash drive to find out the device (/dev/sdc1) that the flash drive would occupy.

Last edited by TracyTiger; 06-05-2014 at 07:25 PM.
Old 06-05-2014, 08:58 PM   #3
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 814

Rep: Reputation: 265Reputation: 265Reputation: 265
Try looking at pmount. It lets any user mount any removeable device in the /media directory. Example:
pmount sdb1
would mount /dev/sdb1 to /media/sdb1. It gives ownership to the user who ran the command. To unmount:
pumount sdb1
NOTE: If you are in the /media directory, and run the umount command above, it will attempt to run it on /media/sdb1, not /dev/sdb1. In that case, either cd out of /media or give the full path to /dev/sdb1.

Hope this helps!
Old 06-05-2014, 09:05 PM   #4
Registered: Jun 2004
Distribution: Slackware
Posts: 241

Rep: Reputation: 49
This should do what you want:

`pmount /dev/sdX1` should mount it under /media/sdX1. Then use pumount as you would use umount.

The source download appears to be behind a login page, here's a mirror:


cli, mount, usb drive

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mounting USB Drive to a user defined point hcgrant Linux - Software 3 05-30-2013 06:05 PM
[SOLVED] user mounting of USB drive... Habitual Slackware 6 07-30-2012 08:42 PM
USB Issues: Exit code 21 kills mounting HD. How to USB diskcheck? jimwg Linux Mint 2 05-05-2012 06:41 PM
Gnome: Auto mounting external devices as first user logged in, not current user yitzle Linux - Software 4 04-01-2008 09:43 AM
Mounting USB external drive with multiple partitions, USB bluetooth mouse xmeson Slackware 7 12-17-2006 09:00 AM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:57 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration