LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
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

Reply
 
Search this Thread
Old 10-04-2005, 12:00 PM   #1
TimmerKahuna
LQ Newbie
 
Registered: Feb 2004
Posts: 2

Rep: Reputation: 0
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?
 
Old 10-04-2005, 12:28 PM   #2
FliesLikeABrick
Member
 
Registered: Aug 2005
Location: NY,USA
Distribution: Debian, Gentoo, Ubuntu
Posts: 103

Rep: Reputation: 15
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
 
Old 10-04-2005, 01:35 PM   #3
TimmerKahuna
LQ Newbie
 
Registered: Feb 2004
Posts: 2

Original Poster
Rep: Reputation: 0
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.
 
Old 10-04-2005, 03:21 PM   #4
FliesLikeABrick
Member
 
Registered: Aug 2005
Location: NY,USA
Distribution: Debian, Gentoo, Ubuntu
Posts: 103

Rep: Reputation: 15
yay my first time really helping someone :P
 
Old 08-13-2006, 11:24 AM   #5
pascalv
LQ Newbie
 
Registered: Nov 2003
Posts: 8

Rep: Reputation: 0
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?
 
Old 08-13-2006, 01:31 PM   #6
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Milwaukee, WI
Distribution: Mint
Posts: 6,642

Rep: Reputation: 69
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
 
  


Reply


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
unable to mount usb pen drive in redhat 9.0 zero79 Linux - Hardware 9 01-25-2007 09:07 PM
help! unable to mount usb-drive ! ag2uki Debian 14 09-29-2006 03:38 AM
Unable to write to external USB drive m_lp_ql_m Linux - Newbie 2 08-29-2005 03:21 PM
Cannot mount a USB drive as read/write. icheyne MEPIS 2 06-28-2005 01:48 AM
How to mount a jump drive gschrade Linux - Newbie 7 01-28-2004 02:06 PM


All times are GMT -5. The time now is 07:27 PM.

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