LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   USB Mount and copy (https://www.linuxquestions.org/questions/linux-newbie-8/usb-mount-and-copy-729821/)

PMP 06-01-2009 06:27 AM

USB Mount and copy
 
I am trying a normal user to mount a usb on linux box, I have given sudo permission to the normal user for mount, umount and modprobe.

Everything works as expected the normal user is able to mount the device but when i try to copy some file to the usb it says permission denied because the mount directory has permission 755 with owner and group "root".

Ho can i make this thing work.

archShade 06-01-2009 07:47 AM

Is there an fstab entry for the stick. In which case you need to add user or owner options to it.

Or you can put in the options when you mount using mount -o <then options separated by a comma(,)>


man mount has exact details on mount options
man fstab has details on fstab

a google search will uncover more details (or at least clearer details w/ examples) on both.

linuxlover.chaitanya 06-01-2009 07:53 AM

The thing is the directory on which you are mounting the usb drive does not have write permissions for normal user. You will need to give permissions to the normal user to write into the directory.
Like if you do this:

sudo mount /dev/sdb1 /mnt/usb

Then /mnt/usb directory should have write permissions for the normal user. Keep in mind that you are just mounting the drive as root. All the other subsequent commands are run as a normal user.

PMP 06-01-2009 08:08 AM

The mount -o option is not working i dont want to add an entry to fstab.

For the second post the mount point has the permission root root hence i cannot change the permission of that mount point with a normal user

rikxik 06-01-2009 08:51 AM

Try somthing like this:

mount -o umask=000 /dev/sdb1 /mnt/usbdrive

Or you can also use uid. Suppose, your uid (output of "id -u" command) is 110, then the mount command will be:

mount -o uid=110 /dev/sdb1 /mnt/usbdrive


All times are GMT -5. The time now is 09:32 PM.