Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux? |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-04-2005, 12:00 PM
|
#1
|
LQ Newbie
Registered: Feb 2004
Posts: 2
Rep:
|
Unable to mount AND write to USB jump drive
I've recently purchased a SanDisk Cruzer Micro USB drive for use with my Redhat 9 distribution. As root, I've been successful in mounting the device with:
mkdir /mnt/cruzer
mount /dev/sda1 /mnt/cruzer
I can then cd to the drive, read and write stuff with no troubles - again, as long as I'm root. No problems so far.
BUT - I am having troubles as a regular user (joe). joe can cd to the drive, read files from the drive, but he can't write anything. joe always gets a "permissiong denied".
OK, so I figure file permissions are the cause. Back at root I display the permissions:
drwxr-xr-x 2 root root 4096 Feb 20 2004 cdrom
drwxr-xr-x 8 root root 16384 Dec 31 1969 cruzer
drwxr-xr-x 2 root root 4096 Feb 20 2004 floppy
and I try to change them:
chmod 777 cruzer
But I get :
chmod: changing permissions of `cruzer' (requested: 0777, actual: 0755): Operation not permitted
The same is true if I attempt to change any of the permissions of files already on cruzer (placed there earlier by root).
Hmm - my first question arrises - Is this because the file system on the jump drive is vfat, and doesn't contain any fields for file permission values?
OK, so I read around a bit and discover that entries in fstab are needed. I modified fstab:
/dev/sda1 /mnt/cruzer auto user,rw,noauto 0 0
I then unmounted and remounted cruzer and got the same results: Root can do it all, but joe can't write anything. I also tried:
/dev/sda1 /mnt/cruzer vfat user,rw,noauto 0 0
(no restarts in between the changes to fstab, but I shouldn't have to, right?)
I also tried to mount cruzer from joe, but 'only root can do that'.
So, I'm at a loss. What can I do differently to allow joe to write to the cruzer?
|
|
|
10-04-2005, 12:28 PM
|
#2
|
Member
Registered: Aug 2005
Location: NY,USA
Distribution: Debian, Gentoo, Ubuntu
Posts: 103
Rep:
|
if you want joe to be able to access it the same way root can, then when you mount it add the option uid=joe
if you want user joeandfriends to be able to access it as well, do gid=joeandfriends
|
|
|
10-04-2005, 01:35 PM
|
#3
|
LQ Newbie
Registered: Feb 2004
Posts: 2
Original Poster
Rep:
|
Too simple!
Thank you, FliesLikeaBrick for the quick and complete reply.
I was unaware of the -o uid option of the mount command. I tried it, it works, I'm moving on.....
Thanks again.
|
|
|
10-04-2005, 03:21 PM
|
#4
|
Member
Registered: Aug 2005
Location: NY,USA
Distribution: Debian, Gentoo, Ubuntu
Posts: 103
Rep:
|
yay my first time really helping someone :P
|
|
|
08-13-2006, 11:24 AM
|
#5
|
LQ Newbie
Registered: Nov 2003
Distribution: Debian Stable
Posts: 8
Rep:
|
Quote:
Originally Posted by FliesLikeABrick
if you want joe to be able to access it the same way root can, then when you mount it add the option uid=joe
if you want user joeandfriends to be able to access it as well, do gid=joeandfriends
|
Thanks; I have the same situation
But, I mounted my USB key file system in my home directory with:
$ sudo mount -o uid=pascalv -o gid=pascalv /dev/sda1 ~/usb
and still cannot change the permissions:
$ chmod 777 ~/usb
$ ls -l
gets
drwxr-xr-x 2 pascalv pascalv 16888 1970-01-01 01:00 usb
and not
drwxrwxrwx
Would somebody have an explanation?
|
|
|
08-13-2006, 01:31 PM
|
#6
|
LQ Veteran
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642
Rep:
|
The issue may be that your USB is formatted as FAT16 or FAT32, which can't recognize POSIX file permissions. Try mounting it like this
Code:
mount -o umask=000 /dev/sda1 /mnt/usb
The umask will cause the device to be mounted with 777 permissions. Good luck with it
|
|
|
All times are GMT -5. The time now is 04:21 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|