Re: fat32 partition



heavytull wrote:

I'm trying to set my computer to mount the fat32 partition so to it to be RW for
all users.
I put in the fstab:
/dev/sda2 /mnt/sda2 vfat auto,umask=002 1 0

but as it is above the partition is RW only for root.
I would like it to be RW also for users so I would like to specify the
group 'users'
I would like to know if it is possible and how to do it.

Question asked many times...

$ man mount
....
FILESYSTEM SPECIFIC MOUNT OPTIONS
....
Mount options for fat
(Note: fat is not a separate filesystem, but a common part
of the msdos, umsdos and vfat filesystems.)
....
uid=value and gid=value
Set the owner and group of all files. (Default: the
uid and gid of the current process.)

umask=value
Set the umask (the bitmask of the permissions that
are not present). The default is the umask of the
current process. The value is given in octal.

At boot time, the process that uses /etc/fstab to mount the fs's is running as root, thus any [v]fat partition is mounted as uid=root, gid=root with the default umask (usually 022 - meaning rwxr-xr-x).

If you don't care about anyone being able to write, add option umask=0 (rwxrwxrwx):

/dev/hda7 /music vfat defaults,umask=0 0 2

Or if you want to allow only selected users to be able to write there (as I have), create a vfat group on a free gid (eg 499) and add that with umask=002 (rwxrwxr-x):

/dev/hda7 /music vfat uid=0,gid=499,umask=002 0 2

and add users you want to write to the vfat partition to the vfat group.

------------------------------------------------------------------------

As you want to use the 'users' group, replace the '499' bit of 'gid=499' with whatever group id the 'users' group has (see in /etc/group), eg:

# grep ^users /etc/group
users:x:100:
# cat >> /etc/fstab
/dev/sda2 /mnt/sda2 vfat uid=0,gid=100,umask=002 0 2
^D
#



.