Linux – Mounting a USB device in Linux

linuxmountpermissionsusb

I have a problem when trying to work with USB devices mounted with user 'root'. I explain, I mount a USB device as root under command line (console mode only), and I can work with that device with no problem, but when changing to one limited account, that device mounted is in read-only mode. I've tried to apply chmod and chown but not to work. Also, I've tried this:

$ sudo mount -t vfat -o rw,users /dev/sdb1 /mnt/pen/

and same result. How can I resolve this without using fstab file? I think there must be a solution, 'cause under X-Windows with a limited account, this USB device is recognized, mounted and worked with no problem.

Best Answer

Try using the uid and gid bits to specify you as the userID which owns the file. You may also want to use umask:

sudo mount -t vfat /dev/sdb1 /mnt/pen -o umask=022,rw,uid=1000,gid=1000
Related Question