Yeah, this is a common problem. It is related to the fact that FAT
filesystems really don't have permissions.
The way that linux handles this is that when you mount a FAT drive, all
the files are given the _same_ file permissions at mount time.
Furthermore, once mounted, these permissions can't be modified.
The default permissions that mount will use for FAT partitions is
"rwxr-xr-x". To change this, you can add an option "umask=" in the fstab
file. For example, on my computer, I use:
/dev/hda1 /mnt/c vfat defaults,umask=0000 0 0
The argument to umask is and octal number. To understand what this number
means, you have to understand how file permissions actually work in unix.
The way file permissions are stored on the disk is as a 9-bit binary
number. The best way to show this is with examples. File permission are
commonly represented in three ways:
rwxr-xr-x - human readable
111101101 - binary number
7 5 5 - 3 octal numbers
The last one is the most important. If you read the manpage for chmod, you
will notice that you can specify the desired permissions using and octal
number. Examples:
gsteele@atlas:~$ chmod 0755 foo
gsteele@atlas:~$ ls -l foo
-rwxr-xr-x 1 gsteele gsteele 1123166 Mar 27 11:42 foo*
gsteele@atlas:~$ chmod 0766 foo
gsteele@atlas:~$ ls -l foo
-rwxrw-rw- 1 gsteele gsteele 1123166 Mar 27 11:42 foo*
gsteele@atlas:~$ chmod 0777 foo
gsteele@atlas:~$ ls -l foo
-rwxrwxrwx 1 gsteele gsteele 1123166 Mar 27 11:42 foo*
(Note: the first number is related to "special file permissions". You
should always leave this number as 0. You can read about these here:
http://www.lns.cornell.edu/public/CO...ls_3.html#SEC4)
Now, umask is like the binary NOT of the file permissions you want. For
example:
rwxr-xr-x - desired file permissions
111101101 - binary file permissions
000010010 - umask
0 2 2 - octal umask
So, for example, in my fstab file, I use umask=0000, so that the
permissions on my dos drive are rwxrwxrwx. If you wanted the permissions
on the dos drive to be rwxrwxr-x, you would set umask=0002.
You can also change the group and the owner of the FAT partition files
using the options uid=value,gid=value in the fstab file, where the values
are the user id number and group id number.
The uid numbers for users are listed in the file /etc/passwd, and the gid
numbers are listed in the file /etc/group:
in /etc/passwd:
gsteele:x:1001:1001:Gary Steele,13-2033,3-4810,:/home/gsteele:/bin/bash
| |
uid default gid for user gsteele
in /etc/group:
gsteele:x:1001:
|
gid for group gsteele
This should sort out any problems.
btw thx mykilx...you had the right idea...i just needed it explained a bit more clearly with the reasoning behind it
thx for your help everyone
evano