Partition vs Cluster

Posted on 2009-12-21
Last Modified: 2013-11-14
What is partitioning and clustering? Is there any correlation between the two?
Question by:srikanthrad
    LVL 1

    Assisted Solution

    Think of a partition as a slice of pizza.  If you have 4 slices, then you have 4 partitions.  Once you create the partition, it can be formatted...

    A Cluster is the logical unit of file storage on a hard disk; it's managed by the computer's operating system. Any file stored on a hard disk takes up one or more clusters of storage. A file's clusters can be scattered among different locations on the hard disk. The clusters associated with a file are kept track of in the hard disk's file allocation table (FAT). When you read a file, the entire file is obtained for you and you aren't aware of the clusters it is stored in.

    Since a cluster is a logical rather than a physical unit (it's not built into the hard disk itself), the size of a cluster can be varied. The maximum number of clusters on a hard disk depends on the size of a FAT table entry. Beginning with DOS 4.0, the FAT entries were 16 bits in length, allowing for a maximum of 65,536 clusters. Beginnning with the Windows 95 OSR2 service release, a 32-bit FAT entry is supported, allowing an entry to address enough clusters to support up to two terabytes of data (assuming the hard disk is that large!).

    The tradeoff in cluster size is that even the smallest file (and even a directory itself) takes up the entire cluster. Thus, a 10-byte file will take up 2,048 bytes if that's the cluster size. In fact, many operating systems set the cluster size default at 4,096 or 8,192 bytes. Until the file allocation table support in Windows 95 OSR2, the largest size hard disk that could be supported in a single partition was 512 megabytes. Larger hard disks could be divided into up to four partitions, each with a FAT capable of supporting 512 megabytes of clusters.

    Author Comment

    So, a file spans multiple clusters if it is big enough. But, can it span multiple partitions? When there is such a trade-off with a cluster, why would anybody use such a concept which is waste of memory and I am guessing somewhat little bit more time to retrieve? Or does it depends upon usage/utilization?
    LVL 1

    Expert Comment

    I would think no
    LVL 70

    Accepted Solution

    First, I'll assume your question is indeed about a cluster in the sense of file allocation clusters, and not related to clustered storage arrays, which is an entirely different topic.

    The general concept detailed above is correct for FAT-based file systems ... but no Windows OS has used FAT as the primary file structure in a decade.    All modern Windows-based OS's uses NTFS file structures, which store the file allocation information in a Master File Table (MFT).     However, the details of this structure aren't relevant to understanding the difference between clusters and partitions.

    A disk is physically accessed by sector number -- where a sector is a fixed size unit of storage on the disk (typically 512 bytes).    At one time, the actual platter, cylinder, and sector were used to access these sectors, but for well over a decade modern disks have been accessed using a single number to refer to the sectors [called the logical block address].     To keep from dividing files into too tiny a "slice", file systems allocation by cluster rather than sector -- a cluster is an allocation unit that is specified when you format the disk (or a partition of the disk) and always consists of contiguous sectors (so it can be read/written very quickly).

    As noted above, when you allocate a file, the minimum size it can occupy is one cluster [EXCEPT for small NTFS files, which can actually be contained entirely in the MFT, but that's another topic].    So the tradeoff in cluster size is that larger clusters can result in higher performance, but waste more space due to "slack" -- the space that's allocated for a file but not needed [statistically, the average amount of space wasted on a disk is 1/2 the cluster size times the number of files].

    Partitioning has NO relationship to cluster size.    Partitioning simply allocates a physical disk in smaller blocks -- these form logical "disks" from the standpoint of the OS.    A slice of pizza is a bad analogy in that the "slices" formed by partitioning are more like rings than wedges -- each partition occupies contiguous cylinders.     There are good reasons to partition a disk -- to segregate the OS from your data [so you can restore an image of the OS or reload the OS without any impact on data];  to segregate different OS's [in a multi-boot environment];  or to maximize the performance of an OS by keeping it on the outermost cylinders of a disk [which have much better data transfer rates than the inner cylinders].     But each of these partitions is it's own logical "disk" -- and must be independently formatted (thus can each have their own cluster sizes, etc.).

    r.e. your 2nd question, "...  Is there any correlation between the two? "  ==>  No.

    Author Closing Comment

    Please post if you have any links that can help me dig deeper.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Sometimes the best way to deal with an infected computer is to boot from external media and run your tools from there.  The reason you may wish to do this really depends on the infection.  Some malware is so recalcitrant that no matter what you do i…
    Lets start to have a small explanation what is VAAI(vStorage API for Array Integration ) and what are the benefits using it. VAAI is an API framework in VMware that enable some Storage tasks. It first presented in ESXi 4.1, but only after 5.x sup…
    This video teaches viewers how to encrypt an external drive that requires a password to read and edit the drive. All tasks are done in Disk Utility. Plug in the external drive you wish to encrypt: Make sure all previous data on the drive has been …
    This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now