| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | AA | AB | AC | AD | AE | AF | AG | AH | AI | AJ | AK | AL | AM | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | This chart calculates the filesystem layout and capacity of an exFAT formatted drive. | ||||||||||||||||||||||||||||||||||||||
2 | Assumes GPT (GUID Partition Table) | ||||||||||||||||||||||||||||||||||||||
3 | Assumes single partition spanning the entire volume (multiple partitions merely have to account for the difference in partitioning overhead vs filesystem overhead and correctly follow partition boundaries when making calculations). | ||||||||||||||||||||||||||||||||||||||
4 | The most convenient unit of data to work with is a "sector". Units are noted in [square brackets]. Probably all flash drives have a logical sector size of 512 bytes. Remember what your high school physics teacher told you about keeping your units straight. It's important! | ||||||||||||||||||||||||||||||||||||||
5 | N.B. Flash storage devices, SSDs including, will often have larger sectors (called pages) physically, but will happily lie about it to the OS. Most spinning rust drives will instead correctly report 4K physical sectors, but will emulate 512 bytes to the OS for the benefit of backwards compatibility. | ||||||||||||||||||||||||||||||||||||||
6 | exFAT specification: https://learn.microsoft.com/en-us/windows/win32/fileio/exfat-specification | ||||||||||||||||||||||||||||||||||||||
7 | |||||||||||||||||||||||||||||||||||||||
8 | Hardware (sort of) | ||||||||||||||||||||||||||||||||||||||
9 | 512 | sector size [bytes] | |||||||||||||||||||||||||||||||||||||
10 | 30851071 | Total drive sectors | device and formatter dependent parameters | ||||||||||||||||||||||||||||||||||||
11 | [KiB] | [sectors] | [clusters] | [bytes] | [sectors] | [KiB] | [clusters] | [KiB] | [KiB] | [bytes] | [sectors] | [clusters] | [clusters] | [KiB] | [sectors] | [sectors] | [sectors] | [sectors] | [sectors] | [sectors] | [KiB] | ||||||||||||||||||
12 | 34 | First use LBA | 2ⁿ | cluster size | cluster size | data | data | wasted space | wasted space | metadata | metadata | total "wasted" space | bitmap | bitmap | bitmap | Up-case table | offset overhead | frac clusters | available for cluster heap | cluster heap offset [sectors] | min cluster heap offset | FAT offset | FAT len | min FAT len | FAT len factors | ceil to even values | cluster heap offset dec2bin | Number of files above which a lower cluster size becomes more efficient. | Avg wasted space per file | ||||||||||
13 | 30851038 | Last use LBA | -1 | 0.5 | 1 | 30605278 | 15669902336 | 0 | 0 | 7486 | 3743 | 125599 | 3825660 | 7472 | 7472 | 12 | 121856 | 30605278 | 30605278 | 243712 | 243056 | 2048 | 241008 | 239104 | 2*4+3+5021 | 15063 | 15064 | 2*3+7+269 | 1884 | 472 | 60 | 16 | 111011100000000000 | 0.25 | |||||
14 | 0 | 1 | 2 | 15363055 | 15731768320 | 0 | 0 | 1884 | 1884 | 63324 | 1920382 | 3751 | 1876 | 6 | 61440 | 15363055 | 30726110 | 122880 | 122552 | 2048 | 120504 | 120024 | 2*3+3+5021 | 15063 | 15064 | 2*3+7+269 | 1884 | 472 | 60 | 16 | 011110000000000000 | 249100 | 0.5 | ||||||
15 | 2048 | First LBA | The only values we care about. | 1 | 2 | 4 | 7696375 | 15762176000 | 2 | 1 | 475 | 950 | 32695 | 962047 | 1879 | 470 | 3 | 31744 | 7696375.5 | 30785502 | 63488 | 62300 | 2048 | 60252 | 60128 | 2*2+3+5021 | 15063 | 15064 | 2*3+7+269 | 1884 | 472 | 60 | 16 | 001111100000000000 | 61258 | 1 | |||
16 | 30851038 | Last LBA | 2 | 4 | 8 | 3852027 | 15777902592 | 6 | 3 | 122 | 488 | 16875 | 481504 | 941 | 118 | 2 | 16384 | 3852027.75 | 30816222 | 32768 | 32176 | 2048 | 30128 | 30094 | 2*4+7+269 | 1883 | 1884 | 2*2+3+157 | 472 | 60 | 16 | 001000000000000000 | 15820 | 2 | |||||
17 | 3 | 8 | 16 | 1926909 | 15785238528 | 14 | 7 | 33 | 264 | 9487 | 240864 | 471 | 30 | 1 | 9216 | 1926909.875 | 30830558 | 18432 | 17120 | 2048 | 15072 | 15054 | 2*5+3+157 | 471 | 472 | 2*3+59 | 60 | 16 | 000100100000000000 | 3694 | 4 | ||||||||
18 | These values are located in the boot sector. | 4 | 16 | 32 | 963710 | 15789424640 | 30 | 15 | 11 | 176 | 5311 | 120464 | 236 | 8 | 1 | 5120 | 963710.9375 | 30838750 | 10240 | 9600 | 2048 | 7552 | 7529 | 2*7+59 | 59 | 60 | 2*2+3+5 | 16 | 000010100000000000 | 1044 | 8 | ||||||||
19 | 2048 | partition offset [sectors] | 5 | 32 | 64 | 481919 | 15791521792 | 30 | 15 | 5 | 160 | 3247 | 60240 | 118 | 2 | 1 | 3072 | 481919.4688 | 30842846 | 6144 | 5824 | 2048 | 3776 | 3765 | 2*6+59 | 59 | 60 | 2*2+3+5 | 16 | 000001100000000000 | 258 | 16 | |||||||
20 | 4096 | FAT offset | 6 | 64 | 128 | 240975 | 15792537600 | 94 | 47 | 4 | 256 | 2351 | 30122 | 59 | 1 | 1 | 2048 | 240975.7344 | 30844894 | 4096 | 3968 | 2048 | 1920 | 1883 | 2*7+3+5 | 15 | 16 | 000001000000000000 | 56 | 32 | |||||||||
21 | 4096 | 7 | 128 | 256 | 120487 | 15792472064 | 222 | 111 | 4 | 512 | 2671 | 15061 | 30 | 1 | 1 | 2048 | 120487.8672 | 30844894 | 4096 | 3072 | 2048 | 1024 | 942 | -10 | 64 | ||||||||||||||
22 | 6144 | partitioning overhead [sectors] | 8 | 256 | 512 | 60243 | 15792340992 | 478 | 239 | 4 | 1024 | 3311 | 7531 | 15 | 1 | 1 | 2048 | 60243.93359 | 30844894 | 4096 | 2560 | 2048 | 512 | 471 | -10 | 128 | |||||||||||||
23 | 9 | 512 | 1024 | 30121 | 15792078848 | 990 | 495 | 4 | 2048 | 4591 | 3766 | 8 | 1 | 1 | 2048 | 30121.9668 | 30844894 | 4096 | 3072 | 2048 | 1024 | 236 | -10 | 256 | |||||||||||||||
24 | 30844894 | sectors available for cluster heap | 10 | 1024 | 2048 | 15060 | 15791554560 | 2014 | 1007 | 4 | 4096 | 7151 | 1883 | 4 | 1 | 1 | 2048 | 15060.9834 | 30844894 | 4096 | 4096 | 2048 | 2048 | 118 | -10 | 512 | |||||||||||||
25 | 11 | 2048 | 4096 | 7529 | 15789457408 | 2014 | 1007 | 4 | 8192 | 13295 | 942 | 2 | 1 | 1 | 4096 | 7529.491699 | 30840798 | 8192 | 8192 | 4096 | 4096 | 59 | -12 | 1024 | |||||||||||||||
26 | 12 | 4096 | 8192 | 3763 | 15783165952 | 6110 | 3055 | 4 | 16384 | 27631 | 471 | 1 | 1 | 1 | 8192 | 3763.74585 | 30832606 | 16384 | 16384 | 8192 | 8192 | 30 | -14 | 2048 | |||||||||||||||
27 | 5836 | Up-case table [bytes] | 13 | 8192 | 16384 | 1880 | 15770583040 | 14302 | 7151 | 4 | 32768 | 56303 | 235 | 1 | 1 | 1 | 16384 | 1880.872925 | 30816222 | 32768 | 32768 | 16384 | 16384 | 15 | -14 | 4096 | |||||||||||||
28 | 12 | Up-case table [sectors] | 14 | 16384 | 32768 | 939 | 15753805824 | 14302 | 7151 | 4 | 65536 | 105455 | 118 | 1 | 1 | 1 | 32768 | 939.4364624 | 30783454 | 65536 | 65536 | 32768 | 32768 | 8 | -12 | 8192 | |||||||||||||
29 | 15 | 32768 | 65536 | 468 | 15703474176 | 47070 | 23535 | 4 | 131072 | 220143 | 59 | 1 | 1 | 1 | 65536 | 468.7182312 | 30717918 | 131072 | 131072 | 65536 | 65536 | 4 | |||||||||||||||||
30 | |||||||||||||||||||||||||||||||||||||||
31 | |||||||||||||||||||||||||||||||||||||||
32 | 64 | Optimal cluster size for maximizing capacity. | Goes x2, but then every once in a while fits just a little bit shy of x2 | ||||||||||||||||||||||||||||||||||||
33 | 30851038 | 16 gig flash stick | May involve bitwise ops. | ||||||||||||||||||||||||||||||||||||
34 | 3907022840 | 2TB drive | May be tied to cl heap offset. | ||||||||||||||||||||||||||||||||||||
35 | 241696759 | 128-ish gig | |||||||||||||||||||||||||||||||||||||
36 | |||||||||||||||||||||||||||||||||||||||
37 | |||||||||||||||||||||||||||||||||||||||
38 | |||||||||||||||||||||||||||||||||||||||
39 | |||||||||||||||||||||||||||||||||||||||
40 | |||||||||||||||||||||||||||||||||||||||
41 | |||||||||||||||||||||||||||||||||||||||
42 | |||||||||||||||||||||||||||||||||||||||
43 | |||||||||||||||||||||||||||||||||||||||
44 | |||||||||||||||||||||||||||||||||||||||
45 | |||||||||||||||||||||||||||||||||||||||
46 | |||||||||||||||||||||||||||||||||||||||
47 | |||||||||||||||||||||||||||||||||||||||
48 | |||||||||||||||||||||||||||||||||||||||
49 | |||||||||||||||||||||||||||||||||||||||
50 | |||||||||||||||||||||||||||||||||||||||
51 | |||||||||||||||||||||||||||||||||||||||
52 | |||||||||||||||||||||||||||||||||||||||
53 | |||||||||||||||||||||||||||||||||||||||
54 | |||||||||||||||||||||||||||||||||||||||
55 | |||||||||||||||||||||||||||||||||||||||
56 | |||||||||||||||||||||||||||||||||||||||
57 | |||||||||||||||||||||||||||||||||||||||
58 | |||||||||||||||||||||||||||||||||||||||
59 | |||||||||||||||||||||||||||||||||||||||
60 | |||||||||||||||||||||||||||||||||||||||
61 | |||||||||||||||||||||||||||||||||||||||
62 | |||||||||||||||||||||||||||||||||||||||
63 | |||||||||||||||||||||||||||||||||||||||
64 | |||||||||||||||||||||||||||||||||||||||
65 | |||||||||||||||||||||||||||||||||||||||
66 | |||||||||||||||||||||||||||||||||||||||
67 | |||||||||||||||||||||||||||||||||||||||
68 | |||||||||||||||||||||||||||||||||||||||
69 | |||||||||||||||||||||||||||||||||||||||
70 | |||||||||||||||||||||||||||||||||||||||
71 | |||||||||||||||||||||||||||||||||||||||
72 | |||||||||||||||||||||||||||||||||||||||
73 | |||||||||||||||||||||||||||||||||||||||
74 | |||||||||||||||||||||||||||||||||||||||
75 | |||||||||||||||||||||||||||||||||||||||
76 | |||||||||||||||||||||||||||||||||||||||
77 | |||||||||||||||||||||||||||||||||||||||
78 | |||||||||||||||||||||||||||||||||||||||
79 | |||||||||||||||||||||||||||||||||||||||
80 | |||||||||||||||||||||||||||||||||||||||
81 | |||||||||||||||||||||||||||||||||||||||
82 | |||||||||||||||||||||||||||||||||||||||
83 | |||||||||||||||||||||||||||||||||||||||
84 | |||||||||||||||||||||||||||||||||||||||
85 | |||||||||||||||||||||||||||||||||||||||
86 | |||||||||||||||||||||||||||||||||||||||
87 | |||||||||||||||||||||||||||||||||||||||
88 | |||||||||||||||||||||||||||||||||||||||
89 | |||||||||||||||||||||||||||||||||||||||
90 | |||||||||||||||||||||||||||||||||||||||
91 | |||||||||||||||||||||||||||||||||||||||
92 | |||||||||||||||||||||||||||||||||||||||
93 | |||||||||||||||||||||||||||||||||||||||
94 | |||||||||||||||||||||||||||||||||||||||
95 | |||||||||||||||||||||||||||||||||||||||
96 | |||||||||||||||||||||||||||||||||||||||
97 | |||||||||||||||||||||||||||||||||||||||
98 | |||||||||||||||||||||||||||||||||||||||
99 | |||||||||||||||||||||||||||||||||||||||
100 |