LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-29-2008, 07:19 AM   #1
tacman08
LQ Newbie
 
Registered: Aug 2008
Posts: 3

Rep: Reputation: 0
Fedora 9: Read-only access to non-root user on a vfat partition


Problem:
I get this error message when trying to make a directory on a vfat partition as a NON-ROOT user. As Root, it works without problems:
[abhi@sulphur1 ~]$ mkdir /media/SHARED/bb
mkdir: cannot create directory `/media/SHARED/bb': Permission denied

Version:
H/w: Lenovo Thinkpad t61, centrino duo, 1 gig ram
S/w: Fedora 9. #uname -a = Linux sulphur1 2.6.25.14-108.fc9.i686 #1 SMP Mon Aug 4 14:08:11 EDT 2008 i686 i686 i386 GNU/Linux

Additional Info:
- The partition in question is vfat formatted. My intent was to create 4 partitions for this dual-boot machine... XP, Linux, Swap, Shared. This is the 'Shared' partition... with it's purpose being to act like a common storage medium between reboots of Win and Fedora.

- I can write to the ntfs XP partition just fine as a non-root user. The problem is only with the vfat partiton. The nfts partition just has the "defaults" option in fstab.

- fdisk -l output:
Device Boot Start End Blocks Id System
/dev/sda1 * 1 4889 36960808+ 7 HPFS/NTFS
/dev/sda2 9564 10337 5851440 12 Compaq diagnostics
/dev/sda3 4890 9563 35335440 f W95 Ext'd (LBA)
/dev/sda5 8074 9563 11264368+ b W95 FAT32
/dev/sda6 4890 4917 200781 83 Linux
/dev/sda7 4917 8073 23864526 8e Linux LVM

Troubleshooting Done:
- Added this line to /etc/fstab followed by a "mount -o remount /dev/sda5":
/dev/sda5 /media/SHARED defaults,user,exec,dev,suid,sgid,uid=500,gid=500,mode=0775,umask=000

- changed owner of both the directory /media/SHARED and /dev/sda5 to user "abhi". "abhi has uid of 500.
[abhi@sulphur1 ~]$ ls -la /dev/sda5
brw-rw---- 1 abhi disk 8, 5 2008-08-29 12:53 /dev/sda5
[abhi@sulphur1 ~]$ ls -la /media/
drwxr-xr-x 6 root abhi 8192 2008-08-29 14:41 SHARED

- Reverted changes to defaults in /etc/fstab. Here is what the mount command gives presently:
[abhi@sulphur1 ~]$ mount
.
removed other info
.
/dev/sda5 on /media/SHARED type vfat (rw,umask=0000)




Any guidance on how i can give non-root users "write permissions" on this vfat partition would be appreicated.

Thank you!
 
Old 08-29-2008, 12:30 PM   #2
Gethyn
Member
 
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Rep: Reputation: 32
Here's what my fstab says for a FAT32 partition, which I can write to:
Code:
/dev/sda3 /media/fat32 vfat defaults,utf8,dmask=0002,fmask=0113,gid=users,noexec 0 1
I'm running Ubuntu 8.04 rather than Fedora though. Hope it helps.
 
Old 08-29-2008, 12:43 PM   #3
berbae
Member
 
Registered: Jul 2005
Location: France
Distribution: Arch Linux
Posts: 540

Rep: Reputation: Disabled
Quote:
ls -la /media/
drwxr-xr-x 6 root abhi 8192 2008-08-29 14:41 SHARED
Have you really a group named abhi ? Isn't it a user name rather than a group name ?
The permissions give only write access to root, even if a group named abhi exists.
 
Old 08-30-2008, 01:56 PM   #4
tacman08
LQ Newbie
 
Registered: Aug 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Hi, thank you for your replies and helping me out. The problem is solved. Here's what was done:

a. remove everything from fstab that i had modified.
b. mkdir /media/SHARED
c. chown abhi /media/SHARED
d. Added this in the fstab file and followed it with a mount -a:
/dev/sda5 /media/SHARED vfat defaults,rw,nosuid,nodev,uhelper=hal,uid=500 0 0
e. rebooted to make sure the changes persisted... and they do! I can write to the vfat partition now as a non-root user.
 
Old 08-30-2008, 02:04 PM   #5
tacman08
LQ Newbie
 
Registered: Aug 2008
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by berbae View Post
Have you really a group named abhi ? Isn't it a user name rather than a group name ?
The permissions give only write access to root, even if a group named abhi exists.
In Fedora, whenever one adds a user to the system, a corresponding group is also created. reflected with the gid being the same as the uid in /etc/passwd and /etc/group. In this case, the group "abhi" has gid 500.

<<The permissions give only write access to root>>
I too feel that was the problem. ref my previous post, that chown command fixed this.

Thank you.
 
  


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
user can only read files on vfat partition bk1 Linux - General 1 08-30-2007 12:05 PM
Non-root user has read-only access to fat-c partition Ook Slackware 12 05-25-2007 09:49 AM
automount vfat partition with rw access for any user Simon Bridge Red Hat 12 05-26-2005 09:37 AM
slackware 10.. root user only gets read only access gtan Slackware 2 09-25-2004 08:51 AM
user can't read/write (vfat) partition MykilX Slackware 6 07-04-2003 06:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:58 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration