The size of File Allocation Table(FAT) depends on the number of clusters, the version used, the size of volume used. For example, a volume with size 8GB and formatted as FAT32 with 4096 bytes sized cluster would be having 2^21 clusters. Now the size of FAT would be number of clusters * address size of a cluster. Address size of each cluster is the number of bits required to store the address. Now as it is FAT32 it would be 32bits. So size of the FAT would be 2^21 * 4(in bytes)= 2^23 bytes. Maximum number of cluster address in a FAT would be 2^28 as 4 bits are used for special purpose.

A file of 4GB would span over 2^20 clusters. Total clusters available are 2^21 Now if we see any file(size is 4GB) the first cluster number at which the data of file starts would be available in the root directory, if that file is in the root directory. And further other clusters linked to the first cluster(where the file resides) can be obtained from the File Allocation Table(FAT). So what's the issue, we have 2^21 clusters and 2^20 clusters are required for the file of size 4GB. It should be able to store it. Why not?

The above information is on the basis of what I know.

migrated from cs.stackexchange.com Oct 9 '18 at 17:57

This question came from our site for students, researchers and practitioners of computer science.

  • Your question is not about CS. Though, the answer is that FAT32 stores exact number of bytes for each file explicitly in 32-bit field. – Dmitri Urbanowicz Oct 9 '18 at 13:54
  • To expand on @DmitriUrbanowicz's comment, we usually view questions about the implementation of specific systems as off-topic here. Questions about the general principles of filesystems are fine, but this one is very much "Why is this specific family of operating systems implemented in this specific way?" – David Richerby Oct 9 '18 at 13:55

Most likely because each file is defined by its directory entry, which has a 32-bit value "file size in bytes", see: https://en.wikipedia.org/wiki/Design_of_the_FAT_file_system#Directory_entry

I guess you can technically make a file with more data in it, but you will have a malformed filesystem and its behavior is undefined.

Your Answer

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