Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Extensible File Allocation Table (exFAT) file system format

The Extensible File Allocation Table (exFAT) file system format is a successor of the File Allocation Table (FAT) file system format.

Overview

An exFAT file system consists of:

  • One or more reserved sectors
    • a boot record (or boot sector)
  • One or more cluster block allocation tables
  • File and directory data

Characteristics

CharacteristicsDescription
Byte orderlittle-endian
Date and time valuesFAT date and time
Character stringsUCS-2 little-endian, which allows for unpaired Unicode surrogates such as "U+d800" and "U+dc00"

Boot record

The boot record is stored in the first sector of the volume.

The boot record is at least 512 bytes in size and consists of:

OffsetSizeValueDescription
03"\xeb\x76\x90"Boot entry point (JMP +120, NOP)
38"EXFAT\x20\x20\x20"File system signature (or OEM name)
11530Unknown (reserved), which must be 0
648Partition offset
728Total number of sectors
804Cluster block allocation table start sector
844Cluster block allocation table size in number of sectors, which must be non 0
884Data cluster start sector
924Total number of data clusters
964Root directory start cluster
1004Volume serial number
1041Format revision minor number
10511Format revision major number
1062Volume flags
1081Bytes per sector, which is stored as 2^n, for example 9 is 2^9 = 512. The bytes per sector value must be 512, 1024, 2048 or 4096
1091Sectors per cluster block, which is stored as 2^n, for example 3 is 2^3 = 8. The sectors per cluster block must be 1 upto 32M (2^25)
1101Number of cluster block allocation tables
1111Drive number
1121Unknown (percent in use), which contains the percentage of allocated cluster blocks in the cluster heap of 0xff if not available
1137Unknown (reserved)
120390Used for boot code
5102"\x55\xaa"Sector signature

Volume flags

ValueIdentifierDescription
0x0001ActiveFatActive FAT, 0 for the first FAT, 1 for the second FAT
0x0002VolumeDirtyIs dirty
0x0004MediaFailureHas media failures
0x0008ClearToZeroMust be cleared
0xfff0Unknown (reserved)

Cluster block allocation table

A cluster block allocation table consists of:

  • One ore more cluster block allocation table entries

Cluster block allocation table entry

A cluster block allocation table entry is 32 bits in size and consists of:

OffsetSizeValueDescription
032 bitsData cluster number

Where the data cluster number has the following meanings:

Value(s)Description
0x00000000Unused (free) cluster
0x00000001Unknown (invalid)
0x00000002 - 0xffffffefUsed cluster
0xfffffff0 - 0xfffffff6Reserved
0xfffffff7Bad cluster
0xfffffff8 - 0xffffffffEnd of cluster chain

Directory

A directory consists of:

  • Zero or more directory entries
  • Terminator directory entry

Directory entry

A directory entry is 32 bytes in size and consists of:

OffsetSizeValueDescription
01Entry type
119Entry data
204Data stream start cluster
248Data stream size

Directory entry type

OffsetSizeValueDescription
05 bitsType type code
0.51 bitIs non-critical (also referred to as type importance)
0.61 bitIs secondary entry (also referred to as type category)
0.71 bitIn use
ValueDescription
0x00Terminator directory entry
0x01 - 0x7fUnused
0x80Invalid
0x81 - 0xffUsed
Directory entry type codes
ValueDescription
Critical and primary
0x81Allocation bitmap
0x82Case folding mappings
0x83Volume label
0x85File entry
Non-critical and primary
0xa0Volume identifier
0xa1TexFAT padding
Critical and secondary
0xc0Data stream
0xc1File entry name
Non-critical and secondary
0xe0Vendor extension
0xe1Vendor allocation
Allocation bitmap directory entry
OffsetSizeValueDescription
010x81Entry type
11Bitmap flags
2180Unknown (Reserved)
204Data stream start cluster
248Data stream size
Case folding mappings directory entry
OffsetSizeValueDescription
010x82Entry type
130Unknown (Reserved)
44Checksum
8120Unknown (Reserved)
204Data stream start cluster
248Data stream size
Volume label directory entry
OffsetSizeValueDescription
010x83Entry type
11Name number of characters
222Name string, which contains an UCS-2 little-endian string without an end-of-string character
2480Unknown (Reserved)

Note that the volume label directory entry should only be stored in the first and/or second directory entry of the root directory.

File entry directory entry
OffsetSizeValueDescription
010x85Entry type
11Unknown (Secondary count)
22Unknown (Set checksum)
42File attribute flags
620Unknown (Reserved)
82Creation time
102Creation date
122Last modification time
142Last modification date
162Last access time
182Last access date
201Creation time fraction of seconds, which contains fraction of 2-seconds in 10 ms intervals
211Last modification time fraction of seconds, which contains fraction of 2-seconds in 10 ms intervals
221Creation time UTC offset, which contains number of 15 minute intervals of the time relative to UTC, where the MSB indicates the offset is valid
231Last modification time UTC offset, which contains number of 15 minute intervals of the time relative to UTC, where the MSB indicates the offset is valid
241Last access time UTC offset, which contains number of 15 minute intervals of the time relative to UTC, where the MSB indicates the offset is valid
2570Unknown (Reserved)
Volume identifier directory entry
OffsetSizeValueDescription
010xa0Entry type
11Unknown (Secondary count)
22Unknown (Set checksum)
42Unknown (Flags)
616Volume identifier, which contains a GUID
22100Unknown (Reserved)
Data stream directory entry
OffsetSizeValueDescription
010xc0Entry type
11Unknown (Flags)
210Unknown (Reserved)
31Name number of characters
42Name hash
620Unknown (Reserved)
88Data stream valid data size
1640Unknown (Reserved)
204Data stream start cluster
248Data stream size
File entry name directory entry
OffsetSizeValueDescription
010xc1Entry type
11Unknown (Flags)
230Name string, which contains an UCS-2 little-endian string without an end-of-string character

File attribute flags

ValueDescription
0x0001Read-only
0x0002Hidden
0x0004System
0x0008Is volume label
0x0010Is directory
0x0020Archive
0x0040Is device
0x0080Unused (reserved)

References