From Wikipedia:File Allocation Table:

File Allocation Table (FAT) is a computer file system architecture and a family of industry-standard file systems utilizing it. The FAT file system is a legacy file system which is simple and robust. It offers good performance even in light-weight implementations, but cannot deliver the same performance, reliability and scalability as some modern file systems. It is, however, supported for compatibility reasons by nearly all currently developed operating systems for personal computers and many mobile devices and embedded systems, and thus is a well-suited format for data exchange between computers and devices of almost any type and age from 1981 up to the present.

File system creation

To create a FAT filesystem, install dosfstools.

mkfs.fat supports creating FAT12, FAT16 and FAT32, see Wikipedia:File Allocation Table#Types for an explanation on their differences. mkfs.fat will select the FAT type based on the partition size, to explicitly create a certain type of FAT filesystem use the -F option. See mkfs.fat(8) for more information.

Tip: For most situations you will want to use FAT32.

Format a partition to FAT32:

# mkfs.fat -F 32 /dev/partition

Kernel configuration

Here is an example of the default mount configuration in the kernel:

A short description of the options:

  • Language settings: , CONFIG_FAT_DEFAULT_IOCHARSET
  • All filenames to lower letters on a FAT partitions if enabled:
  • Enables support of the FAT file systems: , CONFIG_MSDOS_FS,
  • Enables support of a FAT partitioned harddisks on 86x PCs:

If the partition type detected by mount is VFAT then it will run the script.

Writing to FAT32 as normal user

To write on a FAT32 partition, you must make a few changes to the fstab file.

The option means that any user (even non-root) can mount and unmount the partition . gives read-write access.

For example, if your FAT32 partition is on /dev/sda9, and you wish to mount it to , then you would use:

/dev/sda9    /mnt/fat32        vfat   '''user''',rw

Now, any user can mount it with:

$ mount /mnt/fat32

And unmount it with:

$ umount /mnt/fat32

Note that FAT does not support Linux file permissions. Each file will also appear to be executable. You may want to use the option to only mark Windows executables (com, exe, bat) as executable. See for more options.

Detecting FAT type

If you need to know which type of FAT file system a partition uses, use the file command:

Alternatively you can use minfo from the package:

See also

This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.