operating-systemfilesystemsfat

How calculate minimum cluster size for FAT10 with 1 GB disk size?


Let's see we have a file system with FAT10 and a disk size of 1 GB. I'd like to know how I can calculate the minimum size of a cluster?

My current approach looks like this: FAT10 means we have 2^10 clusters. Since the disk size is 1 GB which equals 2^30 bytes, we have 2^(30-10) = 2^20 bytes for each cluster.

Which means the minimum cluster size is 2^20 bytes ?

I hope this is the correct place to ask, otherwise tell me and I will delete this question! :c


Solution

  • It really depends on what your goals are.

    Technically, the minimum cluster size is going to be 1 sector. However, this means that the vast majority of the 1 GB will not likely be accessible by the FAT10 system.

    If you want to be able to access almost the whole 1 GB disk with the FAT10, then your calculation serves as a reasonable approximation. In fact due to practical constraints, you're probably not going to get much better unless you decide to start making some more unorthodox decisions (I would argue using a FAT10 system on a 1 GB drive is already unorthodox).

    Here are some of the things you will need to know.

    1. How many of the theoretical 1024 FAT values are usable? Remember, some have special meaning such as "cluster available", "end of cluster chain", "bad block (if applicable)" or "reserved value (if applicable)"
    2. Does your on-disk FAT10 table reserve its space by count of sectors or count of clusters?
    3. What is your sector size?
    4. Are there any extra reserved sectors or clusters?
    5. Is your data section going to be sector or cluster aligned?
    6. Are you going to limit your cluster size to a power of two?