VMware ESXi and vSphere Cluster Management
FAT File System on Linux
Learn what the FAT file system is, how FAT12, FAT16, and FAT32 differ, and how to mount, format, and manage FAT volumes on Linux.
FAT means File Allocation Table. It is both the name of a filesystem family originally developed by Microsoft and the name of the table that records how storage is allocated to files.
A FAT volume divides storage into allocation units called clusters. A file occupies one or more clusters. The file allocation table records whether clusters are free, reserved, or part of a file, and it can link a file's clusters into a chain. Directories store file names and other basic metadata, while the allocation table helps the filesystem find the file's data.
Why FAT Became Important
FAT was widely used by DOS and later by Windows 9x and Windows ME. It fit the storage technology of early personal computers and became a practical format for exchanging files between different systems.
That history still matters. A FAT-formatted device is often recognized by Linux, Windows, cameras, phones, media players, firmware tools, game devices, and other embedded systems. FAT remains common on removable media because compatibility is usually more important than advanced filesystem features.
FAT Variants
The traditional FAT family includes FAT12, FAT16, and FAT32. The number identifies the approximate width of the cluster-addressing entries used by that variant. A later variant can address more clusters and therefore support larger volumes, although practical limits also depend on cluster size, operating-system support, and device firmware.
| Variant | Typical historical use | Relative capacity | Long filename support context | Current relevance |
|---|---|---|---|---|
| FAT12 | Floppy disks and very small volumes | Smallest of the three | Long filenames were associated with later extensions rather than the original short-name design | Mostly legacy media and specialized devices |
| FAT16 | Older hard disks and removable media | Larger than FAT12, smaller than FAT32 | VFAT extensions enabled long filenames on systems that supported them | Legacy systems and devices with specific requirements |
| FAT32 | Larger removable-storage devices | Larger than FAT12 and FAT16 | Commonly used with VFAT long filename support | Still widely encountered, especially where compatibility is required |
FAT32 is the newest commonly referenced member of the traditional FAT family. It supports larger volumes than FAT12 and FAT16, but it still has important limits. In particular, a FAT32 file cannot normally exceed approximately 4 GiB, even when the volume has plenty of free space.
Linux Support for FAT
Linux can read and write FAT filesystems. Linux commonly exposes FAT volumes through the vfat filesystem type. VFAT is the FAT extension and support layer associated with long filenames and other compatibility behavior on FAT media.
To Linux, mounting means making a filesystem accessible at a directory in the Linux directory tree. A typical workflow is to identify the correct partition, create a mount point, and mount the partition as vfat.
Identify a Device and Its Filesystem
lsblk -f
blkid
Look for the removable device's size, label, UUID, partition name, and current mount point. Device names such as /dev/sdX are examples only; the actual device might be different. Always verify the target before formatting or mounting it.
Mount a FAT Volume
sudo mkdir -p /mnt/fat
sudo mount -t vfat /dev/sdX1 /mnt/fat
Here, /dev/sdX1 represents a partition and /mnt/fat is the directory through which its files become available.
Control Linux-Visible Ownership
FAT does not store normal Unix ownership and permission metadata for each file. Linux therefore presents ownership and access modes using mount options rather than reading them from the FAT volume.
sudo mount -t vfat -o uid=1000,gid=1000,umask=022 /dev/sdX1 /mnt/fat
uid=1000presents files as owned by user ID 1000.gid=1000presents files as belonging to group ID 1000.umask=022removes selected permission bits from the default presentation.fmaskanddmaskcan separately control file and directory modes.
These options affect how Linux presents the mounted volume. They do not write Unix ownership information into the FAT filesystem.
Format a Partition as FAT32
sudo mkfs.fat -F 32 /dev/sdX1
Unmount Removable Media Safely
sudo umount /mnt/fat
Unmount before unplugging the device so pending writes can finish and the filesystem is left in a consistent state.
Example Persistent Mount
UUID=YOUR-UUID /mnt/fat vfat defaults,uid=1000,gid=1000,umask=022 0 0
Replace YOUR-UUID with the actual UUID reported by lsblk -f or blkid. Persistent entries in /etc/fstab require care with removable devices because the device may not always be connected.
FAT's Main Advantage: Compatibility
FAT is useful when one storage device must move between systems that do not share a native filesystem. A FAT-formatted USB flash drive can commonly be exchanged between Linux and Windows, inserted into a camera, read by a media player, or used by a firmware utility.
This broad support is FAT's central strength. Modern Linux filesystems can provide richer metadata, permissions, journaling, and other features, but a consumer device may not understand them. A simple FAT volume is often the safest compatibility choice for exchange media.
Typical Uses
- Floppy disks: FAT12 was a classic format for floppy media.
- USB flash drives: FAT32 is often chosen when Linux and Windows compatibility is required.
- Memory cards: Cameras, phones, media players, and other consumer devices may expect a FAT variant.
- Embedded and firmware tools: Simple FAT support is common in devices with limited operating-system features.
- Temporary exchange storage: FAT is suitable when files need to be copied between unrelated systems.
Limitations and Trade-offs
| Area | FAT behavior | Practical consequence |
|---|---|---|
| Compatibility | Supported by many operating systems and consumer devices | Excellent for exchange media and legacy-device support |
| Permissions | Does not store standard Unix user, group, and mode data per file | Linux uses mount options such as uid, gid, umask, fmask, and dmask |
| Journaling | Traditional FAT does not provide journaling | Recovery after power loss or removal can be less robust than with a journaling filesystem |
| Large files | FAT32 has an approximately 4 GiB maximum single-file size | Large disk images, videos, and backups may not fit as one file |
| Metadata | Provides fewer advanced filesystem features than modern Linux filesystems | Less suitable for Linux-only storage with complex permissions or metadata needs |
| Crash safety | No journal records pending metadata changes | Use safe removal and avoid disconnecting the device during writes |
Choosing FAT or Another Filesystem
| Storage task | Recommended filesystem direction | Reason |
|---|---|---|
| Sharing a USB drive between Linux and Windows | FAT32 when files stay below its single-file limit | Broad compatibility with common desktop and consumer systems |
| Using a card in a camera or other legacy device | The FAT variant required by the device | Device firmware may require a particular variant, partition layout, or capacity range |
| Linux-only backup disk | A modern Linux filesystem such as ext4 | Supports Unix permissions, journaling, and larger files more appropriately |
| Storage requiring Windows compatibility and large files | Consider NTFS or another format supported by all target systems | FAT32's single-file limit may be unsuitable, but compatibility must be tested |
| Specialized Linux storage | Consider ext4 or another native filesystem; JFS is another related alternative | Advanced requirements may outweigh universal device compatibility |
Choose FAT when maximum device compatibility, simple file exchange, or legacy support is the priority. Choose ext4 or another native Linux filesystem when the storage is Linux-only and you need Unix permissions, journaling, robust large-file support, or richer metadata.
Practical Examples
Sharing a USB Drive
For a drive shared between Linux and Windows, FAT32 is a reasonable choice if no individual file exceeds approximately 4 GiB. Check the file sizes before copying large videos, virtual machines, or disk images.
Copying a Large Disk Image
If a disk image is near or above 4 GiB, FAT32 may reject it despite having enough free space. Use a filesystem that supports larger files, or split the image into smaller pieces if the receiving workflow supports reassembly.
Setting Access for a Shared User
If files on a mounted FAT drive appear owned by the wrong user or are not writable, unmount and remount with suitable uid, gid, and mask options. Remember that these settings control the Linux view of the mount and are not per-file FAT permissions.
Troubleshooting FAT on Linux
The Drive Mounts but Ownership Is Wrong
FAT does not retain standard Linux user and group ownership. Remount it with the intended user's numeric uid and group gid, along with an appropriate umask, fmask, or dmask.
A Large File Will Not Copy
On FAT32, confirm the individual file size. Free space is not enough when the file itself exceeds the filesystem's approximately 4 GiB limit. Use another filesystem or split the file.
FAT Support or Utilities Are Missing
If mounting reports an unknown filesystem type, verify that the Linux kernel and installed packages provide FAT/VFAT support. If formatting tools are missing, install the distribution package commonly named dosfstools, which provides mkfs.fat.
The Wrong Device Is About to Be Formatted
Internal disks and removable devices can have similar names. Use lsblk -f to compare sizes, labels, UUIDs, filesystem types, and mount points. Stop if the device identity is uncertain.
A Legacy Device Rejects the Volume
Some consumer devices require a particular FAT variant, partition layout, or capacity range. Consult that device's requirements and format the volume accordingly.
Exam-Relevant Notes
- FAT stands for File Allocation Table.
- A cluster is the allocation unit that stores part of a file.
- FAT12 is associated mainly with floppy disks, FAT16 with older disks and removable media, and FAT32 with larger removable devices.
- Linux commonly mounts FAT volumes using the
vfatfilesystem type. - VFAT is associated with long filename support on FAT media.
- FAT's major advantage is interoperability, not advanced Linux metadata.
- Traditional FAT does not store standard Unix ownership and permissions per file and does not provide journaling.
- FAT32 has an approximately 4 GiB maximum single-file size.
- Use mount options such as
uid,gid, andumaskto control the Linux-visible access behavior of a FAT mount.
For a related overview of this topic, see FAT File System.