Mounting FAT filesystems
The FAT filesystem can be mounted with permissions less restrictive than the default. This can be done by either
changing the user that mounts the FAT filesystem or by explicitly changing the permissions that the FAT filesystem is
mounted with. The permissions are inherited from the process that mounts the FAT filesystem. Since the process that
mounts the FAT filesystem is usually a startup script running as root the FAT filesystem inherits root’s permissions.
This results in the files on the FAT filesystem having permissions similar to files created by root. For example:
~>whoami
root
~>touch root_file
~>ls -l root_file
-rw-r-r- 1 root root 0 Dec 10 00:20 root_file
which matches the owner, group and permissions of files seen on the FAT filesystem except for the missing ’x’s. The
permissions on the FAT filesystem can be changed by changing root’s umask (unset permissions bits). For example:
~>umount /c
~>umask
022
~>umask 073
~>mount /c
~>cd /c
/c>ls -l
-rwx--r- 1 root root 91 Oct 10 17:58 autoexec.bat
9
Chapter 3. Installing/compiling Wine
-rwx--r- 1 root root 245 Oct 10 17:58 config.sys
drwx--r- 41 root root 16384 Dec 30 1998 windows
Mounting the FAT filesystem with a umask of 000 gives all users complete control over it. Explicitly specifying the
permissions of the FAT filesystem when it is mounted provides additional control. There are three mount options that
are relevant to FAT permissions: uid, gid and umask. They can each be specified when the filesystem is manually
mounted. For example:
~>umount /c
~>mount -o uid=500 -o gid=500 -o umask=002 /c
~>cd /c
/c>ls -l
-rwxrwxr-x 1 sle sle 91 Oct 10 17:58 autoexec.bat
-rwxrwxr-x 1 sle sle 245 Oct 10 17:58 config.sys
drwxrwxr-x 41 sle sle 16384 Dec 30 1998 windows
which gives "sle" complete control over /c. The options listed above can be made permanent by adding them to the
/etc/fstab file:
~>grep /c /etc/fstab
/dev/hda1 /c vfat uid=500,gid=500,umask=002,exec,dev,suid,rw 1 1
Note that the umask of 002 is common in the user private group file permission scheme. On FAT file systems this
umask assures that all files are fully accessible by all users in the specified group (gid).