Question

All the sites I go to look for informations on FAT16 just declaratively state that it can not allocate more than 2 GB. OK. Great. I believe you. But how do you come to that conclusion (other than just testing it)?

Is there some sort of formula one can use to determine how much a FAT16 system can hold?

Was it helpful?

Solution

FAT16 uses 16 bits to identify clusters. Thus there are a maximum of 65536 clusters before you run out of identifiers, and some identifiers are reserved for non-file uses. Each file occupies at least one cluster. Larger clusters increases the minimum allocation per file, increasing the overhead of small files.

The cluster size then tells you the maximum identifiable volume. For 32KiB clusters, that is 32 * 1024 * 65536 B = 2GiB.

You could increase the cluster size indefinitely, by increasing the size of your on-disk sectors, but you remain limited to the maximum number of files. You would also run into issues with software that assumed the default sector size (512B)

At the point where there were physical volumes of ~2GiB readily available, processors and OSs were 32bit, so moving to FAT32 was a sensible choice, allowing vastly more files in small clusters

OTHER TIPS

There were actually several variants of "FAT16" over the years with different limits but lets consider the version that persisted from "compaq DOS 3.31" through to windows 95.

FAT volumes are divided into clusters. Each cluster is made up of a power of two number of sectors. The number of sectors per cluster on FAT16 is stored as an 8 bit signed number. So the maximum possible sectors per cluster is 64.

Cluster numbers were stored as a 16 bit unsigned value. Limiting total clusters to 65536. Multiply that by the maximum sectors per clusters and you get a limit of 4194304 sectors.

The (logical) sector size of hard drives is 512 bytes. Multiply that by the limit on the number of sectors mentioned above and you get your 2GiB limit. In priciple a medium with larger sector sizes can support a larger FAT16 volume but I don't think this happened in practice.

Windows NT changed the interpretation of the "sectors per cluster" field to be unsigned 8 bit. This allowed a 4GiB FAT16 partition with 512 byte sectors (and theoretically larger on drives with bigger sectors). AIUI windows 98 added support for reading and writing such partitions but it couldn't create them and it's disk utilities couldn't repair them.


It would have certainly been possible to make relatively minor tweaks to the filesystem format to support larger clusters and hence larger volumes. However MS decided to go for the more radical option of moving to a 32-bit cluster index with windows 95 OSR2 producing FAT32.

I belive the reason for going for the more radical option was space efficiency. Given typical filesizes at the time 32kiB clusters were already pretty wasteful and larger ones would have been even move so.

Licensed under: CC-BY-SA with attribution
scroll top