13

Referencing this page: https://support.microsoft.com/en-us/kb/140365

NTFS doesn't go over 4KB cluster size until the volume goes over 16TB, and FAT32 maxes out at 16KB in the 16GB–32GB volume range on modern versions of Windows.

exFAT however only defaults to 4KB in the 7MB–256MB volume range. After that it jumps to 32KB in the 256MB–32GB range, and 128KB beyond that.

Why is that? A relatively high cluster size seems wasteful, especially in a format designed for smaller external devices, like flash drives. Doubly so if you're formatting flash memory, because as I understand it, the main benefit to larger cluster size is faster IO due to less fragmentation and less overall clusters to read. Correct me if I'm wrong, but flash memory is much, much less prone to slowdowns caused by fragmentation. So why make the cluster size so high?

  • "Size" and "high" do not go together. Numbers can be "high". "Large" is the bettor word instead of "high". – sawdust Sep 13 '18 at 21:42
  • Possible duplicate of Downsides of a small allocation unit size – sawdust Sep 13 '18 at 21:44
  • just wanted to mention that I just formatted a 1TB drive using default cluster size, and windows used a cluster size of 2048KB!!! This is not only defying the specs on their page, this is always WAYY too high – woojoo666 Sep 16 '18 at 9:23
  • For anyone who reached this by Googling & might ever back up a git directory to the drive/card in question, it's important to know downside of large sectors, too: each ~200 byte file in a git directory takes up 1 full allocation unit. Large sectors can make dev dirs (which can have 10k+ tiny files) take up a large multiple of their normal HDD sizes. Ex: superuser.com/questions/704218/… superuser.com/questions/1370780/… – kcrumley Jul 8 '19 at 18:09
12

Because exFAT is used primarily for things like large capacity SD cards, and on SD cards you must erase a sector before you can write to it. If you were to use small clusters on a card with a large erase sector size it would result in many erase and write commands to the same sector write a several sequential clusters worth of data to disk not only reducing performance but also prematurely wearing out the flash cells. The erase sector size is generally not documented in card datasheets but can be found in the CSD register of the card. The contents of this register will vary from card to card depending on its internal design. Since SD cards are generally used in things like cameras which store large files, the wasted space of a large cluster size isnt important, and only would be if you were storing very large numbers of very small files which generally does not happen.

This webpage has the contents of this register for about a dozen cards:

http://goughlui.com/2014/01/03/project-read-collect-decode-sd-card-csd-register-data/

And if you enter its contents in to the following calculator you can see for a few of the 32/64GB cards the erase sector size is 128 blocks with a block being 512 bytes. And for a 2GB card the erase sector size is 32 blocks with a block being 1024 bytes.

http://goughlui.com/static/csdecode2.htm

Wether or not Windows is smart enough to query the CSD register and suggest a cluster size, or if it simply guesses based on the partition or disk size is unknown. If you were to emulate a SD card with a microcontroller, you could find out.

| improve this answer | |
  • 1
    i did not know about needing to erase flash memory before you could write to it. That makes sense now. Thanks! – InsanityOnABun Dec 2 '16 at 21:36
  • 1
    You seem to be assuming that SD cards have no flash translation layer, i.e. that adjacent logical sectors will always be physically adjacent in NAND. Otherwise the logical sectors in a cluster would not have to belong to the same eraseblock. What evidence do you have to support this assumption? – sawdust Sep 13 '18 at 21:33
  • Indeed some high performance SD cards and flash drives do have a translation layer and yet still come pre-formatted with 32kb clusters?? I have verified that 4kb clusters improves performance for random writes and reads – thomasrutter Mar 17 at 0:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.