HowTo [Suse]: set disk access permissions for Fat32 (VFAT) on a desktop PC

Introduction: Continuing Windows users who install Linux like to maintain a Fat32 partition for data storage and swapping between Windows and Linux. Often they get "Permission denied" or similar messages when they try to write to the Fat partitions. This Tutorial shows how you set the user and group IDs in the file system table located at /etc/fstab to allow broad writeable access. The easy way is just to edit the fstab entries entries but if you're from Windows Land you will be slaves to the GUI for a while. I do include fstab entries for advanced users who might browse here for reference.

PNG IMAGE: ERROR

Scene Setting: The screenshot to left, Pic 1, shows my filesystem viewed in Yast's Expert Partitioner, located at Yast --> System --> Partitioner. Yours will of course be different.

There are eleven partitions in this example on my primary drive, sda, and the Fat32 partition is highlighted in blue, partition sda3. We're only concerned here with the Fat32 partition.

Mount Point: The files on the Fat32 partition will appear in a directory/folder of your choice once sda3 is mounted. For illustration I choose "fat32" in the directory /mnt; this directory is conventionally used in Suse for locating mounts although there's no compulsion to use it. So for illustration the mount point is /mnt/fat32.

Mounting using Yast: In Yast --> System --> Partitioner you highlight the Fat32 partition in Pic 1 and click "Edit". The screen in Pic 2 opens up and there you insert into the panel for "Mount Point" the path to the directory of your choice; e.g. /mnt/fat32.

PNG IMAGE: ERROR PNG IMAGE: ERROR

Then Click "Fstab Options" in Pic 2 to set ownership and other details. The screen in Pic 3 will open up. Activate the selection "Device Name". If the line users,gid=users,umask=0002,utf8 is not in the slot for "Arbitrary option values" then type it in. This line gives ownership to root and read/write access to all users. These permissions are meaningless in Windows and do not carry across when viewed there. In Windows all files belong to all users.

From this point you click the appropriate "OK", "Next" and "Apply" buttons to make it happen.

Permissions on the mount point: The mount point, /mnt/fat32, needs to have ownership=root and group=users. In openSUSE 10.3 that happens automagically but it doesn't happen that way in openSUSE 10.2 or Suse 10.0, 10.1. You must make the necessary changes to the mount point (folder/directory) when the partition is NOT mounted.

Here are the extra steps needed in Suse 10.0, 10.1 and openSUSE 10.2.

  • Open a terminal and assume root privileges with command: su
  • Unmount the partition with command: umount /dev/sda3
  • Change ownership with command: chown -R root:users /mnt/fat32
  • Change permissions with command: chmod 775 /mnt/fat32
PNG IMAGE: ERROR

Just for completeness, you could do the last three steps in a GUI using Konqueror or Nautilus. First unmount the partition. Then Navigate to the folder /mnt/fat32 and change the ownership and permissions as shown for Konqueror on the left in Pic 4.

Here is the entry in fstab for the mount:

/dev/sda3       /mnt/fat32       vfat       users,gid=users,umask=0002,utf8=true 0 0

Bug in Yast Partitioner in openSUSE 10.3: Sometimes in 10.3 the line in fstab for the mount lists the device by device ID rather than by device path as emphasised in red in Pic 3. Why? It is because even though you choose "Device name" in Pic 3, you get "Device ID" transferring through to fstab. That's a bug in Yast Partitioner but only in 10.3. You can fix that by editing the entry in fstab and changing it to look like the line directly above. You can edit fstab directly with this command in a terminal:

For KDE use kdesu kwrite /etc/fstab

For Gnome use gnomesu gedit /etc/fstab

I will remove this bug work-around when and if it's fixed. Please let me know if you discover it's fixed before I do.

But I want Privacy From Others: In this case you make the mount point in the territory of the chosen user, say at /home/michael/fat32. It's a standard folder with no special permissions, owned by "michael" with default permissions drwxr-xr-x. Do that first. You can mount the partition in Yast using the new mount point (/home/michael/fat32) instead of the one shown in Pic 2 and these "Arbitrary options" instead of the ones shown in Pic 3: uid=michael,gid=users,utf8=true.

Now the Fat32 partition will be writeable by Michael and readable by all users. If you want absolute privacy you can make a directory within fat32 that is "forbidden" to all users but Michael. Note that you cannot make the directory fat32 forbidden to other users, only directories under directory fat32. Here is the entry in fstab for the fat32 partition under these more restricted circumstances:

/dev/sda3       /home/michael/fat32       vfat       uid=michael,gid=users,utf8=true 0 0

That's all folks. Hope it helps.

Swerdna May 13 2006; updated 07 November2007