Active2 years, 7 months ago
  1. Allocation Unit Size For Exfat
  2. Best Allocation Unit Size For Exfat Mac And Pc

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

Make sure the allocation unit size is set to default and type in a volume label. Click Start to format the drive. Tags: disk utility, mac, microsoft, os x, windows. For example, if you have a file sized 512KB and you have 128KB allocation unit size, your file will be saved in 4 units in the disk (512KB/128KB). If your file's size is 500KB and you have 128KB AUS, your file still be saved in 4 units in the disk because as mentioned above 128KB is the smallest size of an allocation unit.

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?

InsanityOnABunInsanityOnABun

1 Answer

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:

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.

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.

Muh FugenMuh Fugen

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

In addition to asking for the file system you’d like to use, disk formatting tools will also ask for an “Allocation unit size”. What does this mean and what value should you select?

Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.

The Question

SuperUser reader Andrew Keeton is curious about what exactly he’s supposed to put in the allocation section when formatting a drive. He writes:

I’m formatting a 1TB external hard drive as NTFS. This drive is mainly meant for storing media such as music and video.

What should I choose for the allocation unit size setting? The options range from 512 bytes to 64K. Are there any guidelines that I might apply to other drive types? Should I stop poking around and just leave it at “default?”

While the default setting is usually the best choice for most users, let’s dig a little deeper.

The Answers

Allocation Unit Size For Exfat

SuperUser contributors Jonathan and Andrew offer some insight. Jonathan writes:

If you are a “Standard User” by Microsoft’s definition, you should keep the default 4096 bytes. Basically, the allocation unit size is the block size on your hard drive when it formats NTFS. If you have lots of small files, then it’s a good idea to keep the allocation size small so your harddrive space won’t be wasted. If you have lots of large files, keeping it higher will increase the system performance by having less blocks to seek.

But again, nowadays hard drive capacity is getting higher and higher it makes small difference by choosing the right allocation size. Suggest you just keep the default.

Also keep in mind that the majority file are relatively small, larger files are large in size but small in units.

Andrew expands upon Jonathan’s answer with:

In terms of space efficiency, smaller allocation unit sizes perform better. The average space wasted per file will be half the chosen AUS. So 4K wastes 2K per file and 64K wastes 32K. However, as Jonathon points out, modern drives are massive and a little wasted space is not worth fussing over and this shouldn’t be a determining factor (unless you are on a small SSD).

Compare 4K vs 64K average case waste (32K-2K = 30K), for 10,000 files that only comes out to 300,000KB or around 300MB.

Instead think about how the OS uses space. Let’s say you have a 3K file which needs to grow 2K. With a 4K AUS the data needs to be split over two blocks – and they may not be together so you get fragmentation. With a 64K AUS there are a lot fewer blocks to keep track of and less fragmentation. 16x the block size means 1/16th the number of blocks to keep track of.

For a media disk where you photos, music and videos are stored, every file is at least 1MB I use the biggest AUS. For a windows boot partition I use the Windows default (which is 4K for any NTFS drive smaller than 16TB).

Best Allocation Unit Size For Exfat Mac And Pc

To find out what the cluster size is on an existing disk:

fsutil fsinfo ntfsinfo X:

Allocation

Have something to add to the explanation? Sound off in the the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.

READ NEXT
  • › What Should You Do If You Receive a Phishing Email?
  • › Why Do You Have to Log In to Your Home PC, Anyway?
  • › The Best New Features in Android 10, Available Now
  • › How to Use the chown Command on Linux
  • › What’s New in Windows 10’s 20H1 Update, Arriving Spring 2020