20

I want to use Windows 7 to format a ~4 GB USB flash drive in the FAT32 file system. (I want to format it in FAT32, not NTFS.)

In Windows Explorer, I right-click the flash drive and click Format.

  • The Format dialog box appears [(A) below].

  • The allocation unit size is set to 4096 bytes when the dialog box opens, but when I open the pulldown menu [(B) below], I see that there are other choices.

  • When I click the Restore device defaults button, the allocation unit size is changed to "Default allocation size" [(C) below], although it fails to specify what the default allocation size actually is.

Windows 7 format

What allocation unit size should I use for this ~4 GB USB flash drive, and why?

Would the answer be different for a different capacity flash drive (~16, ~32, or ~64 GB, for example)?

(I want to be able to use the flash drive on both Windows and Mac, so I am choosing FAT32. I will be storing some mp3 on the flash drive.)

12
+150

For quick readers:

In general:

It depends on what kind of data you are intending to store on the device. For all data storage media types at all sizes:

  • Small cluster sizes are more suitable for many small files such as documents and plain text.
  • Large cluster sizes rather match large files. This is more multimedia-oriented.
  • In today's world, it makes no noticeable difference as it did decades ago. Feel free to use the pre-selected cluster size, which is usually 4 KB (4096 Bytes).

Details:

Let's dive into the details.

  • Even an empty file would take the full block size on FAT32. Newer and more modern file systems such as BtrFS and ext4 have more efficient ways of handling it. The latter one, and possibly both for instance are able to store multiple small files in one cluster. But that is also an ancient problem due to extremely developing storage sizes.
  • If a file grows beyond any single/multiplied cluster size (e.g. for 4KB cluster size: 4096, 8192, 12288, 16384, 20480, n×4096, etc…), and the next cluster after the file is already used by a different file, fragmentation happens.
  • FAT32 is the default and most commonly supported USB file system for embedded systems such as car radios and USB HiFi, Boomboxes for your music. It is possible, that specific devices suffer from compatibility problems with exotic cluster sizes. You may try out a few, but the default 4 KB (4096 Bytes) is the most likely size to be supported.

Because flash drives (i.e. SDD, SD, USB) have closely zero access times and no moving parts, file fragmentation is less of a problem there. There is no head that needs to jump to and seek the data block position LBA (logical block address) of where the file continues. This is normally no noticeable delay, but can turn into a minor problem, if an operating system is running on that disk, and needs access to many files and huge amounts of data in real-time.

But a larger cluster size results into fewer clusters holding more data, which makes it easier, thus faster for the computer to handle.

Today's computers are so fast, that, as already mentioned, the selected cluster size does not make much of a difference in average usage cases, especially for flash drives. Hard drives are prone to performance drops with increased file fragmentation, but modern operating systems and file systems regularly defragmentize by default, and even allow using RAM and auxiliary storage (ie.SSD) as block cache, where frequently used data will be stored onto for faster access.

That is the process of reversing the file fragmentation, simply said. The dedicated Wikipedia article shows a graphical animation, which may help your understanding.

Graphical animation: Illustration of file fragmentation and defragmentation.

Summary: It makes no relevant difference in today's world in your case.

Music, what you mentioned in your question, does not require extreme reading speeds at all. Even the reading speed of floppy disks is sufficient for music.

  • 1
    Good answer. Though you should change zero access time to something else, because though seek/read times are faster, perhaps an order of magnitude faster, for flash devices than for a spinning disk for instance, they are not zero. – Xalorous Jan 24 '18 at 13:44
  • 1
    I am so grateful for the bounty. Thanks. – neverMind9 Jan 26 '18 at 16:30
9

The Microsoft article Default cluster size for NTFS, FAT, and exFAT has this table for default cluster sizes :

image

As your drive has 3.63 GB in size, the default sector size is 4KB. As you can see, the larger the disk, the larger is the sector size suggested by Microsoft.

As far as how the sector size affects disk space usage, the Wikipedia article File Allocation Table - FAT32 has this calculation :

The boot sector uses a 32-bit field for the sector count, limiting the FAT32 volume size to 2 TiB for a sector size of 512 bytes and 16 TiB for a sector size of 4,096 bytes.

Therefore any sector size will allow the usage of your entire disk space.

Your choice should be :

  • If you have lots of small files, choose a suitable sector size to contain the majority of the files (unlikely for mp3 files)
  • Otherwise, stay with the default sector size of 4KB. Even if most of your files are much larger than 4KB, you will not gain anything from a larger sector size. Furthermore, the larger the sector size, the more disk space is lost as unused, since, statistically speaking, about half of the last sector of such a file will be allocated but never used. Sector size of 4KB is the most widely used size and so may be better supported on more devices.
4

When you format it, the disk is split in allocations units. Each not empty files on the disk will have one or more allocations units attributed to store its content. So, the smallest file will take 4KB on the disk. It could be useful to reduce it if you have a lot of small files. In your case, for the mp3 the default will be fine.

The general tab of file properties showing 4KB on disk size The general tab of file properties showing 4KB on disk size

2

You can use anything you want and it will work. The differences are:

Wasted space

The block size is the minimum size occupied by a file, so it you save a 2 KB file with 4 KB allocation units you just wasted 50%. And if you save a 2 KB file with a 16 KB allocation units you wasted 87.5%.

Unless you are storing a lot of very small files wasted space is not a problem. In your case it's definitely not as you will be storing mp3 files which will be multi MB in size.

You can check the wasted space of whole folders and not just single files by comparing Size and Size on disk in Properties > General. See below

enter image description here

Performance loss

The physical sector size is the minimum amount of data a drive can read or write. If you format with allocation units smaller than the sector size you will lose performance.

Let's say your flash drive has 8 KB sectors and you format with 4 KB allocation units. You ask to write 4 KB, but the minimum the drive can read of write is 8 KB. What would happen is you ask to write 4 KB, it reads 8 KB, it combines the new 4 KB and the old 4 KB, it writes 8 KB.

In your case a 4 GB flash drive has very bad performance anyway, so you don't care too much. If you want to find out what the sector size of your drive is, you run multiple "performance tests" (copy big files to drive) formatting with bigger allocation size between tests. When the performance stops improving you have reached the drive block size.

  • 1
    Compatibility with non-PC devices will be increased by choosing the default (4kB). – Xalorous Jan 24 '18 at 13:46

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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