|
Windows File System clusters explained
|
|
About Clusters
Have you ever wondered what all those little boxes are when you defrag your hard drive? These boxes are clusters; they are storage units on the hard drive. This article will explain to you the concept of clusters. This applies mostly to the file systems FAT12, FAT16 and FAT32. FAT12 is only seen on floppy disks and very small storage medias, while FAT16 is the older version of FAT in the win95 days, and FAT32 is newer, and more in the Win98 days. Fat Stands for file allocation table. And no, there is no such thing as a SKINNY32 file system. :P
How FAT works
The way FAT works is that it keeps a record at the start of the drive of all the files, and to point to the files, it points to the clusters that contain the files. The main rule of clusters is that there cannot be more than 1 file per cluster, otherwise pointing to that cluster would cause problems, as it would be pointing and doing read/write operations on two files at once, which would crash more than you ever seen Windows crash before. Depending on the size and FAT version of the partition, the cluster size can vary. Also keep in note that a section of a partition is reserved for the FAT, which is the record of each file and where they can be found. This changes in size depending on the size of the partition and clusters as well.
Limitations
Each FAT type has their limits, here is a table displaying these limits:
FAT type | Max Clusters | Cluster sizes | Max volume size |
FAT12 | 4 086 | 0.5 to 4KB | 16 736 256 bytes (~16MB) |
FAT16 | 65 526 | 2KB to 32KB | 2 147 483 648 bytes (2GB) |
FAT32 | 268 435 456 | 4KB to 32KB | 8 796 093 022 208 bytes (8TB) |
Important Notes
The number of maximum clusters is calculated by doing 2^X where X is the number of FAT (ex: FAT12). Also, there are some reserved clusters (10 for FAT12 and FAT16) which is why there are some "missing" if you calculate it yourself. FAT32 is actually calculated 2^28 and not 2^32 because of some reservations.
FAT32 actually supports 64KB clusters, however, most applications don't, so it is hardly ever seen used. 32KB is usually the limit.
FAT32 volume size limit
Note, FAT32's limit is known to be 2TB, but this is because a 8TB partition would be very inefficient as the FAT would be about 1GB, and it would be next to impossible to cache this in memory for fast retrieval. There are many other better file systems for partitions this big. 2TB is probably the highest that would actually work ok. But it IS possible to have a 8TB partition using FAT32, but it is not recommended at all.
Experimenting With Clusters
Here's an experiment you can try on a large FAT partition:
(For this example, lets assume it is using 32KB clusters)
Create a 1 byte file (just a text file and put a space or character in it) and make 1000 copies. It is best to create 10 copies, than take those 10 and copy them 10 times, and then another 10 times. It will go faster than pasting 1000 times. Use CTRL+C and CTRL+V to do the copy paste operation. This should take less than 30 seconds to accomplish. Once you have 1000 files in the folder, stop. You may get access violation errors as Windows becomes confused with this process, so make sure you recopy the missing files to end up with 1000. (We're only using 1000 here since it's a nice big round number)
Hopefully you did this in a seperate folder and not on your desktop!
Now check the properties of that folder and you will see that this 1000 bytes of data actually takes up 1000 bytes times 32KB, which is ~31MB!!! Talk about wasting space eh? This is because only 1 file per cluster can be stored, and even if it's only 1 byte, the clusters are 32KB (in this example) so is used for 1 file, no matter what. These are the biggest clusters you will ever see, but most common as we all like big partitions, and past 32GB, the clusters need to be 32KB since there would be too many clusters, and like in the table above, there is a limit to how many clusters there can be on a partition, so if you want 4KB clusters, you need a pretty small partition.
|

Properties dialog shows how much wasted space is used even with 1 byte files
|
Written By: Red Squirrel
Date: 4-11-04
Printer Friendly
|
|
|
| |