HowTo [Suse / openSUSE] mount FAT32 (VFAT) partitions with read-write access
Versions: openSUSE 10.3 & 11.x
FAT32 is a dying breed in large hard drives but it's widely found in the archaic form (FAT) in miniature devices like USB pen drives. Some users still like to have a "traditional" FAT32 drive on board, a hangover from the days of Windows 98 and 2000. There's some confusion about making them writeable in Linux so I've made this HowTo as a handy web reference point.
↑↑↑↑Anatomy of a typical FAT32 mount
If you accept the default treatment of existing partitions when you install openSUSE, you find it mounts NTFS and FAT32 partitions in the /windows directory, in sequentially numbered sub-directories C, D, E.... and so on. So look for your FAT32 files in there. The default ownership is owner=root, group=users and the files have permissions as follows: owner=read-write, group=read-write, others=read-only (drwxrwxr-x). Consequently, normal users have read-write access to the FAT32 filesystem.
The mount is controlled by an entry in the file system table, a text file called fstab which is located at /etc/fstab. Here's a typical entry:
That's all on one line in the fstab. The device's ID scsi-SATA_SAMSUNG_SP0842NS0DWJ1DP700695-part9 is openSUSE's way of mounting a device by the "Device ID". I show later how to mount a FAT32 partition with the much simpler "Device Name", which in this case is sda9.
Using text files is actually how Linux looks at the situation. Many users prefer GUI devices when manipulating settings. Here's a screenshot of the mount as seen with Yast. GoTo Yast --> System --> Partitioner. The screen to the left will open.
All the partitions are listed including the FAT32 (in blue). The device name (sda9) is /dev/sda9, the size is 100 Mbytes, the mount point is /windows/F (and I added the Volume Label VFAT).
If you highlight the FAT32 partition as in the screenshot and click "Edit" you will access the underlying options in the configuration, as in the next screenshot.
Continuing the tour of Yast's Partitioner: Notice the mount point is /windows/F as chosen by the installation program.
Here you could change the mount point or format the partition (not of interest to-day).
You can go deeper by clicking the button "Fstab Options" and the screen below will open.
Here you can see that the openSUSE installer has entered the options users, gid=users, umask=0002 and utf8=true which make the partition writeable to normal users as well as allowing normal users to mount or unmount the device.
[PS: the option "utf8=true" is not the preferred expression (which is the single word "utf8"). I'll use the preferred expression in this tutorial.]
That finishes the tour of how a FAT32 partition should be configured. There are two ways with identical results: you can edit the text file fstab directly or you can use cumbersome GUIs as we do in Windows.
↑↑↑↑Mounting a new FAT 32 partition permanently
Suppose you did not allow the openSUSE installer to mount the sda9 FAT32 partition permanently or suppose you created sda9 after the installation of openSUSE. Whatever, you have an unmounted FAT32 partition on /dev/sda9. If you don't know where it is, then you can find it with this console command: sudo /sbin/fdisk -l | grep FAT. The dialogue goes like this:
You can use the Yast Partitioner to mount the partition or you can edit the file fstab directly.
Using a text editor: First create a directory in a convenient location; e.g. /windows/C. Then open fstab in a superuser text editor with either of these commands in a terminal window:
When the file opens enter this line in the bottom:
If you prefer to make the mount owned and operated by just one user (e.g. john) then make a directory in a convenient location (e.g. /home/john/win_drive) and use this variant:
Be sure before you save the edited file that you make the last line in fstab a blank line. Save the file. The partition will now mount at boot time. If you want to mount it straight away, use this console command (first enter su to get rootly powers): mount -a
Using Yast's partitioner: If you prefer to do it the hard way, GoTo YAST --> System --> Partitioner. A screen like Pic 1 will open up, showing the FAT32 partion (in this example in position sda9). The only difference from Pic 1 will be that the mount point will not be there because the partition is not mounted.
Highlight the partition (in blue) and click the Edit button. Pic 2 will open. Enter the mount point of your choice; e.g. perhaps /windows/C. Then click the button Fstab Options. The following options should automatically appear in the slot titled Arbitrary Option value: users,gid=users,umask=0002,utf8. If they're not there (e.g. you have an early version of Suse) then add them. You can name the "Volume Label" with a name of your choice if you wish. Then click OK/next/finish, etc to make it all happen.
↑↑↑↑Mounting a FAT32 partition temporarily (from the command line)
There are three things to do if you want to mount a FAT32 partition temporarily:
↑↑↑↑Automounts for USB drives: when you plug in/switch on a FAT32 USB drive it should automount writeable for the user who is operating the workstation. If it doesn't then use these console commands (as root) to investigate: fdisk -l will show the FAT32 partition and mount will show whether it's mounted. If it is mounted then unmount it with a command like this (as root): umount /dev/sda9. If/when it's unmounted you can use the command line to mount it writeable for you as I illustrated immediately above.
That's all folks. Hope it helps.
Swerdna May 13 2006; last updated 20 February 2009