Linux permissions problem (can't write to FAT32 drive)

TheGrandHooHa

Senior member
Jun 28, 2001
408
0
0
I have a FAT32 (Windows) drive mounted in Linux. As root, I can read, write, and do everything else to it just fine. However, any user other than root cannot write to the drive. So I tried changing the permission of the drive in the /mnt directory. However, I cannot change the permissions either through the GNOME properties dialog or by using CHMOD. EVEN AS ROOT!

What am I missing? How can I make it so all my usernames can write to my Windows partition.

Sorry that this is a newb question, but I am trying to experiment and learn that way, and this is a sticking point.

-TGHH
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
FAT has no way of handling permissions, that's why chmod/chown don't work, so Linux emulates them but defaults to root for security reasons.

You can put options in /etc/fstab to set the uid,gid on the mounted directory, type 'man mount' to see what options are available for each filesystem.
 

TheGrandHooHa

Senior member
Jun 28, 2001
408
0
0
After fooling with fstab, the drive now appears on my non-root desktops when mounted but I still cannot write as anything other than root.

It is read-only to anyone but root, but that is because even root cannot make it non-read only. As root, I cannot change owner or change mode or anything. And Windows doesn't have it read-only either... I don't even think you can make a whole drive read-only.

HELP!
 

TheGrandHooHa

Senior member
Jun 28, 2001
408
0
0
Actually, I have it set in fstab to write as read-write. But still only root can save to it, and root cannot change the permissions to what I need. All I need to do is check off one little checkbox or change the ownership, but the box unchecks itself instantly and the checkmarks immediately disappear when I try (as root) to change something.

Is it usually this difficult?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
It's not if you read the documentation.

Like I said, read the manual for mount 'man mount' and see all the options FAT and other filesystems take, after that you need to put them in /etc/fstab to stay permanent.
 

TheGrandHooHa

Senior member
Jun 28, 2001
408
0
0
I read man mount. I've added users, owner, group, rw (for read write) to fstab. I can't see anything else in there that remotely relates to this.

Maybe I am stupid, but I'm pretty sure I have exhausted what man mount and man fstab have to offer. I've added everything remotely related to permissions and still no dice.
 

spyordie007

Diamond Member
May 28, 2001
6,229
0
0
Originally posted by: Nothinman
As root, I can read, write, and do everything else to it just fine.

If the device was mounted read-only even root wouldn't be able to write to it.
That's what I get for not paying close enough attention
rolleye.gif


-Spy
 

TheGrandHooHa

Senior member
Jun 28, 2001
408
0
0
OK, here's what I've done... still not working but I may be getting close.

I've put a bunch of commands into fstab. I've managed, through using -o gid=nobody and uid=nobody to change the ownership to nobody. However, the results are the same: can't write to it as anyone but root, and if I try to check off the 'write' tab for the 'others' group, it immediately unchecks itself, before I can even click OK. Using CHMOD generates an error, basically saying that a permission change is forbidden. CHOWN gives the same result.

I can post the line from fstab if necessary, but I have ton of commands in there now and I doubt there's much left.

Thanks for the help so far guys!
-TGHH
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
/dev/something /mnt/windows vfat rw,uid=500,gid=500,umask=0000 0 0

That's all you should need, you may be able to use names instead of numbers for the uid and gid, but I can't remember for sure. I'm also not 100% sure about the umask setting but you can adjust that if the permissions aren't right.
 

TheGrandHooHa

Senior member
Jun 28, 2001
408
0
0
You are a god, Nothinman! That did it. I never thought to use the umask command, and that's probably what did it. Yeah, I'm a dumbarse.

Thanks for your time and the help!

-TGHH