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
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.)

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
# cat >> /etc/fstab
/dev/sda2 /mnt/sda2 vfat uid=0,gid=100,umask=002 0 2


Relevant Pages

  • Re: Write permission on Fat-Partition to Users
    ... > the users have no write permition to the partition. ... FILESYSTEM SPECIFIC MOUNT OPTIONS ... At boot time, the process that uses /etc/fstab to mount the fs's is running ... and add users you want to write to the vfat partition to the vfat group. ...
  • Re: "Permissions Denied" error as root: SOLVED
    ... To recap, attempting to run a script, as root, with permissions 755 ... The problem was that the partition was mounted with 'users,defaults' ... Changing the line in fstab to 'defaults' and quick 'umount' and 'mount' ... will change the mount options without actually unmounting the device in ...
  • SUMMARY: Moving /usr From Under Root "/" To Its Own Partition
    ... One of the reasons for doing this is to end up with a smaller root ... Install the boot block and boot off the new drive. ... " In order for the root partition to be fscked and remounted ... D> temporarily on the existing disk. ...
  • Re: Grub Manual
    ... I have digested what you all have said and applied it to the small file I wrote on the Grub Manual. ... Please no more about what is root. ... Many people keep the entire Linux in one partition and in that case both of the root point to the same partition. ... Your computer often wants to use the name of the kernel. ...
  • Re: user failures
    ... I had my boot drives partition table zeroed out last night by something ... to the filter screen, but when I click the apply button, anything I've ... I've nuked /root/kmailrc, and then restarted kmail as root, with no ...