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. |
fstab
Quote:
Code:
/dev/sdc1 /mnt/flash auto noauto,users 0 0 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. |
Try looking at pmount. It lets any user mount any removeable device in the /media directory. Example:
Code:
pmount sdb1 Code:
pumount sdb1 Hope this helps! |
This should do what you want: http://slackbuilds.org/repository/14.1/system/pmount/
`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: http://ponce.cc/slackware/sources/re...0.9.23.tar.bz2 |
All times are GMT -5. The time now is 04:02 AM. |