Skip to content

ExFAT Filesystem

Levente Santha edited this page May 11, 2026 · 1 revision

ExFAT Filesystem

Microsoft's ExFAT filesystem for flash drives and large filesystems, supporting files larger than 4GB.

Overview

ExFAT (Extended File Allocation Table) is a filesystem designed by Microsoft for flash storage devices where NTFS is not suitable. It removes the 4GB file size limit of FAT32 and supports volumes larger than 2TB, making it ideal for SDXC cards, USB drives, and other removable media.

JNode's ExFAT implementation is a read-only driver (fs/src/fs/org/jnode/fs/exfat/) that extends AbstractFileSystem<NodeEntry>. It reads the volume's boot sector, upcase table, and cluster bitmap to enumerate the directory tree.

Key Components

Class / File Role
ExFatFileSystem.java Main filesystem implementation, extends AbstractFileSystem
ExFatSuperBlock.java Boot sector and main metadata structure
ExFatFileSystemType.java FileSystemType plugin entry point for detection and mounting
Node.java, NodeFile.java, NodeDirectory.java Directory entry representation
NodeEntry.java Raw directory entry parsing
ClusterBitMap.java Cluster allocation bitmap
UpcaseTable.java Uppercase conversion table for case-insensitive lookups
DirectoryParser.java Directory tree traversal

How It Works

Mount Flow

  1. ExFatFileSystemType.create() probes the device by reading the boot sector
  2. ExFatSuperBlock.read() validates the filesystem signature and reads volume parameters
  3. Root directory is parsed via DirectoryParser to build the Node tree
  4. Cluster bitmap and upcase table are located from the root directory
  5. Files and directories are accessed through the Node abstraction

Directory Structure

ExFAT directories are linear streams of NodeEntry records. Entries include:

  • Volume GUID entry — identifies the filesystem
  • Allocation bitmap entry — points to the cluster bitmap
  • Upcase table entry — Unicode case conversion data
  • File/directory entries — name fragments, timestamps, cluster allocation
  • Stream extension entries — file size and first cluster
  • File entry — attributes, timestamps, first entry hash

Names longer than 15 UTF-16 characters are split across multiple name entries. File hashes are computed to quickly locate entries.

Gotchas & Non-Obvious Behavior

  • JNode's ExFAT driver is read-only — writes are not yet implemented
  • ExFAT uses a timestamp format with 10ms resolution and a different epoch than FAT
  • The upcase table is mandatory and used for all name comparisons
  • Deleted files are immediately overwritten; there is no undelete mechanism

Related Pages

Clone this wiki locally