LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 01-11-2005, 09:01 PM   #1
Chomper
LQ Newbie
 
Registered: Jan 2005
Location: Columbus Ohio
Distribution: Slackware 11
Posts: 23

Rep: Reputation: 15
Can't get write permission to vfat


So i just formatted and reinstalled FC3. For some reason i can't get write-permission to the vfat part of my harddrive (my linux is sharing this with windows 2000 pro). I had this problem before. I'm asking for help now before i have a chance to screw anything up. At the moment, only the root can write and delete stuff from my the vfat drive. Here is my fstab

Code:
# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/                 /                       ext3    defaults        1 1
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /dev/shm                tmpfs   defaults        0 0
none                    /proc                   proc    defaults        0 0
none                    /sys                    sysfs   defaults        0 0
/dev/hdb3               /thepit                 vfat    defaults        0 0
/dev/hdb2               swap                    swap    defaults        0 0
/dev/hdd                /media/cdrom            auto    pamconsole,exec,noauto,managed 0 0
/dev/hdc                /media/cdrecorder       auto    pamconsole,exec,noauto,managed 0 0
/dev/fd0                /media/floppy           auto    pamconsole,exec,noauto,managed 0 0
I have the filesystem mounted to a folder called /thepit . You can see it here:
Code:
ls -l
drwxr-xr-x   15 root root 32768 Dec 31  1969 thepit
Things i have tried (logged in as su from a terminal window) are:
Code:
[root@rdrt-164-107-205-128 /]# chmod 777 thepit
[root@rdrt-164-107-205-128 /]# ls -l
drwxr-xr-x   15 root root 32768 Dec 31  1969 thepit
Nothing changed

Code:
[root@rdrt-164-107-205-128 /]# chgrp chomper thepit
chgrp: changing group of `thepit': Operation not permitted
doesn't work either

I've tried other things but in the interest of keeping this post moderately short, i won't list them all. Any help that anyone could offer on this would be greatly appreciated. I don't want to have to log in a root every time i want to write to this filesystem. Thanks in advance...
 
Old 01-11-2005, 09:11 PM   #2
Tuvok
Member
 
Registered: Mar 2003
Distribution: FreeBSD 6.1, NetBSD 3.0.1
Posts: 170

Rep: Reputation: 30
You need to add user to the /dev/hdb3 line of your /etc/fstab. Something like:
Code:
/dev/hdb3               /thepit                 vfat    rw,noauto,user,owner        0 0
 
Old 01-11-2005, 09:32 PM   #3
Chomper
LQ Newbie
 
Registered: Jan 2005
Location: Columbus Ohio
Distribution: Slackware 11
Posts: 23

Original Poster
Rep: Reputation: 15
So i made the changes you just told me. The only thing that has changed is that now the drive shows up as its own icon in the "computer" window. i still cannot write to the disc from my non-root account. I tried to chmod and chgrp the folder but i get the same thing as before. any more ideas?
 
Old 01-12-2005, 03:01 PM   #4
Chomper
LQ Newbie
 
Registered: Jan 2005
Location: Columbus Ohio
Distribution: Slackware 11
Posts: 23

Original Poster
Rep: Reputation: 15
Any more ideas on how i might get write permission to my drive?
 
Old 01-12-2005, 04:47 PM   #5
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 53
This looks just like a problem over in software.
Here's how my entry in the /etc/fstab looks. The entry is for /dev/hdb1 fat partition.
After making the changes in your /etc/fstab, this is one of those rare occasions where you might need to reboot for things to take effect.

To make it writable for users with a group id of 500, edit the /etc/fstab file to include the following line /dev/hdb1 /mnt/win vfat gid=500,umask=002 0 0

To give the user complete control of that directory, try something like this in the fstab....
/dev/hdb1 /mnt/win vfat uid=500,gid=500,umask=000 1 0
 
Old 01-12-2005, 10:13 PM   #6
Chomper
LQ Newbie
 
Registered: Jan 2005
Location: Columbus Ohio
Distribution: Slackware 11
Posts: 23

Original Poster
Rep: Reputation: 15
So i messed around with my fstab like you told me and IT WORKS!!! Thank you very much! That problem has been killing me for about a month. As a follow-up:

I noticed that by adding either umask=002 or gid=500, i was able to gain write-access to the disk. I only needed one or the other. I was hoping someone could explain to me exactly what both of those mean. I have a good idea that gid=500 tells the computer that the people in the group with group id 500 are allowed to access the disk. I know Chomper (me/my group) has a group id of 500. umask on the other hand, i don't know. I've seen umask=000, umask=0000, umask=002....what does all of this mean? Thanks for helping me out!!
 
Old 01-12-2005, 11:09 PM   #7
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 53
Glad you got it working!
uid is the user id and gid is the group id. If you have more than one user, then put those users into a group and use that gid in the fstab. A quick way to find out that info for user ( fred )
is to type: id fred

Basically, umask changes the permissions of folders and files. You can experiment with results in your home directory and a file which you created. For example: echo mudd > test.txt
Then type: ls -l *.txt and different flavors of chmod to see how things change.
For example: chmod 0755 test.txt
ls -l *.txt

You can get a good idea of how it works at this site ...
http://electron.mit.edu/~gsteele/linuxfaq/
 
Old 01-12-2005, 11:18 PM   #8
Chomper
LQ Newbie
 
Registered: Jan 2005
Location: Columbus Ohio
Distribution: Slackware 11
Posts: 23

Original Poster
Rep: Reputation: 15
The problem the guy was having in the link you sent me is almost identical to mine! Hahaha. Thanks alot for the link and for the help!
 
Old 01-12-2005, 11:25 PM   #9
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 53
You're welcome!
 
Old 01-12-2005, 11:38 PM   #10
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,262

Rep: Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561Reputation: 561
As you learned, the chmod command doesn't work for some non-native file systems. You need to include the information as options in the mount command, or the /etc/fstab entry.

If you wanted to use file permissions of 'rw_rw_rw' for files and 'rwxrwxrwx' for directories, you could use the 'fmask' and 'dmask' options rather than the 'umask' option.
For publicly writable partitions, you may want to forbid execution access on the partition. There are also 'noexec', 'nodev' and 'nosuid' options. These three options are implied if you use the 'users' option, however, if you don't want a any normal user to be able to unmount the filesystem, you will need to supply these options seperately.

Also, for the 'uid=' option, you can use your user name instead of having to look up your UID number.

Last edited by jschiwal; 01-12-2005 at 11:39 PM.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
vfat sambar write permission problem melinda_sayang Linux - Networking 1 10-22-2005 12:48 PM
problems with vfat (permission error) nistelrooy Linux - Software 2 04-04-2005 07:22 AM
permission for vfat partition kringla Linux - General 3 08-22-2004 05:43 PM
vfat execute permission Akuji Slackware 3 08-20-2004 12:38 PM
vfat partition - write permission for users group digitized_funk Linux - Newbie 8 03-19-2003 07:30 AM


All times are GMT -5. The time now is 10:11 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
Open Source Consulting | Domain Registration