Ex FAT
Ex FAT
Dr. G T Raju
1 Professor and Head, Computer Science and Engineering Department,
R N S Institute of Technology, Bangalore, India.
ExFAT
Agenda
82 8 “FAT32 ”
Root directory 96 4 First cluster of root directory 44 4 First cluster of root directory
Bytes per Sector 108 1 This is power of 2; Minimal value is 9; 29 =512 11 2 Count of bytes per sector; This can have
Bytes and maximum 2 12 =4096 Bytes following values 512,1024,2048 or 4096.
Sector per 109 1 This is power of 2; Minimal value is 1; 20 =1 13 1 Number of sectors per cluster; allowed values
cluster sector (512 Bytes) and maximum 32 MB cluster are 1,2,4,8,32,64 and 128. Maximum of 128
size in bytes sectors per cluster
Number of clusters
Cluster heap starting
data cluster
Number of FATs
Starting sector of
cluster heap
Number of sectors per cluster
8GB–16GB 8KB
16GB-32GB 16KB
2TB-16TB
*Assuming Sector size is 512
bytes, then beyond 127GB is
16TB – 32TB 8KB
not supported by FAT32, as
per FAT spec, the FAT entry
32TB-64TB 16KB
size is 32 bits but only 28 bits
64TB – 128TB are used for cluster entry. 32KB
8 128TB – 256TB
>256TB
64KB
Reserved 24 8
12
ExFAT
Reserved 2 18
Cluster Heap
8 Bits l Generally the cluster 2 contains the
cluster heap
Clusters 9-2 00000001 l if cluster heap size is more than
cluster size; then the index 2 of File
Clusters 17-10 00000000 Allocation Table (FAT) contains the
Clusters 25-18 next cluster number which contains
-------- the cluster heap.
Clusters 33-26 There can exist multiple clusters (
-------- l
Data cluster chain in FAT) as cluster heap
------ -------- l Every Bit in the Cluster heap
clusters
------
-------- contains the status of the data
cluster; 0 – Free; 1- Allocated
l Byte 0 contains allocation status of
cluster 2 to cluster 9
l Byte 1 contains the allocation status
Clusters N – [N-8] -------- of cluster 10 to cluster 17
l Byte 2 contains the allocation status
14 of cluster 18 to cluster 25 and so on
ExFAT
Reserved 1 3
Table checksum 4 4 Check sum of the Up-case table
Reserved 8 12
First cluster 20 4 First data cluster
15
ExFAT
Up-Case Table
l The Up case Table is series of
Unicode character mappings.
l One of the uses of the Up case
table is “lower case” to “Upper
case” conversion when file/directory
searching is performed.
l Up case table is always Read-only.
l If cluster heap is only one cluster
and it is cluster 2; then the Up case
table starts from cluster 3.
l By default, Up-case table starts
immediately after the cluster heap.
l If Up case table size is more than
cluster size; File Allocation Table
(FAT) contains the cluster chain
specifying the data clusters in
which content of Up case table is
available.
l Example:
– WinHex tool Snap shot of first few
bytes of Up-case Table
– Lower case letter “a ( 0x:61)”
16 converted to Upper case “A (0x41)”
by having value 0x0041 at the 16
bit index 0x61.
ExFAT
l The Read-only, Hidden, System, Directory and Archive bit fields are file attribute are same as
FAT32 File attributes structure.
l Volume Id is reserved in file attribute of ExFAT, because there is exist a dedicated directory
entry to represent the volume name of the disk/partition
18
ExFAT
19
ExFAT
Bits 2 – 7 : Reserved
Reserved 2 1
Name length 3 1 Length of file name in bytes ( Maximum of 255 Unicode characters)
Name hash 4 2 Hash of the file name; Used while searching for fie/directory name
Reserved 6 2
Valid data length 8 8 The size of the file of directory in bytes
Reserved 16 4
First cluster 20 4 First data cluster of the file/directory
20 Data length 24 8 The size of the file of directory in bytes; In case of directory maximum size is 256MB
ExFAT
Bits 2 – 7 : Reserved
l Single File name Extension directory entry can contain 15 Unicode characters.
l Maximum File name size is 255 Unicode characters
l Hence , for a single long file/directory name maximum of 17 file name extension directory
entries are possible.
21
ExFAT
l The Most Significant Bit (MSB) of Entry Type field of the directory entry will be
changed from 1 to 0 to indicate the directory entry is deleted.
l For example, A file contains the following directory entries
– File Directory Entry , Entry Type is 0x85 = 0x10000101 in binary format
– Stream Extension Directory Entry, Entry type is 0xC0 = 0x11000000 in binary format
– File name extension Directory Entry, Entry type is 0xC1 = 0x11000001 in Binary
format
l The MSB (7th) Bit indicates “In Use” field; it means 1 – In use, 0 – deleted.
l This MSB bit is changed from 1 to 0 to indicate the deletion process;
– File Directory Entry , Entry Type is 0x85 is changed to 0x05 = 0x00000101 in binary
format
– Stream Extension Directory Entry, Entry type is 0xC0 is changed to 0x40 =
0x01000000 in binary format
– File name extension Directory Entry, Entry type is 0xC1 is changed to 0x41=
0x010000001 in binary format
l The Entry type of the volume label is 0x83 = 0x10000011 in binary format.
l This Entry type value 0x83 will changed to 0x03 = 0x00000011 to indicate that
there is no volume label.
22
ExFAT
ExFAT l
400000
FAT32
NTFS
NTFS
l For small files higher performance
ExFAT Ext3
range is 300MB/S ( Mega bytes per
300000
Ext4
second) to 700MB/S.
l For larger files, the performance range
200000 is 1MB/S to 12MB/S.
l The ExFAT is implemented as FUSE(
100000 File system in User space) module.
l FAT32 has seen good and in
0 performance for both smaller and
16384 32768 65536 131072 262144 larger files.
24 File size in KiloBytes
ExFAT
Test Setup
Reader Performance Computer Dell Computer, Optiplex GX620
Duel core 3.4Ghz with 2GB RAM
850000
Operating system Ubuntu 9.04 with Linux kernel version 2.6.28
Test Setup
Writer Performance
Computer Dell Lap-top, Latitude D630
450000
Intel Core 2Duo CPU 2.4 GHz, &1.17Ghz
Operating system Windows XP Profession version 2002,
400000 Service pack3
Storage device Transcend 4GB Thumb drive
350000
Performance tool Iozone version 3.3
300000
l The fie size range 16MB to 256MB
Write peformance in kilobytes/Second
Test Setup
Re-Writer Performance
Computer Dell Lap-top, Latitude D630
Test Setup
Reader Performance
Computer Dell Lap-top, Latitude D630
1200000 Intel Core 2Duo CPU 2.4 GHz, &1.17Ghz
Operating system Windows XP Profession version 2002,
Service pack3
1000000
ExFAT Storage device Transcend 4GB Thumb drive
Performance tool Iozone version 3.3
800000
Read performance in Kilobytes/Second
ExFAT
l The fie size range 16MB to 256MB
600000 FAT32 l The buffer size : 4MB to Read
FAT32 NTFS l NTFS is has lowest performance
400000
below 100 MB/S
l Both ExFAT and FAT32 has higher
performance range 400MB/s to
200000 2GB(Giga Bytes)/S
NTFS
0
16384 32768 65536 131072 262144
References
l US patent Application: 12/389396, “QUICK FILENAME LOOKUP USING NAME”,
Ravishankar V.Puipeddi, Vishal V.Ghotge, Ravinder S.Thind, Microsoft Corporation.
l US patent Application: 11/752872, “EXTENDING CLUSTER ALLOCATIONS IN
EXTENSIBLE FILE SYSTEM”, Ravishankar V.Puipeddi, Vishal V.Ghotge, Sarosh
C.Havewala, Ravinder S.Thind, Mark J Zbikowski, Microsoft Corporation.
l US patent Application: 11/229485, “EXTENSIBLE FILE SYSTEM”, Ravishankar
V.Puipeddi, Vishal V.Ghotge, Sarosh C.Havewala, Ravinder S.Thind, Mark J
Zbikowski, Microsoft Corporation.
l “Reverse Engineering the Microsoft Extended FAT file system(ExFAT)”, Robert
Shullich, SANS Institute InfoSec Reading Room
l “Extended FAT file system”, Jeff Hamm, Paradigm Solutions, Techno Forensics
Conference, October 2009.
l www.ntfs.com
l Free Fuse based ExFAT implementation for Linux : http://code.google.com/p/exfat/ ,
Developer : Andrew Nayenko
l Iozone,” File systems performance benchmarking tool”: http://www.iozone.org/
l FAT Specification:
http://msdn.microsoft.com/en-us/windows/hardware/gg463080
29
ExFAT
Questions
30