0

In the context of spinning disk media such as floppy and hard disks, do these terms all refer to the same underlying concept, differing only by which term is used by which platform?

There are many sources on the internet that use two of these terms interchangeably, or state that they're synonymous; but it's very hard to find a source that clearly states whether or not the first three are synonyms or whether there's some subtle difference. It's also not difficult to find sources, such as this YouTube video, that seem to contrast two of the terms, or at least give them non-identical definitions.

It seems that they all refer to an abstract/logical unit of storage which consists of multiple not necessarily contiguous physical sectors.

Obviously some or all of the terms also have other meanings in other contexts. This question tries to focus on how they are used for disk storage. "Granule" was the term used across TRS-80 models, clones, compatibles, and OSes. (One TRS-80 OS, NEWDOS/80 actually had "lumps" as well as "granules".)

As an extra, would "allocation unit" be the best umbrella term to be universally understood across platforms?

hippietrail
  • 4,605

2 Answers2

2

As you hinted when you mentioned the TRS-80, the terminology differs between operating/file systems. The Linux ext4 file system "allocates storage space in units of 'blocks'. A block is a group of sectors between 1KiB and 64KiB, and the number of sectors must be an integral power of 2. Blocks are in turn grouped into larger units called block groups."

According to another StackExchange thread, however, "Unix untilities often use the word 'block' to mean an arbitrarily sized unit...unrelated to any particular filesystem or disk hardware."

The Windows FAT32 and NTFS file systems use clusters, which are also referred to as allocation units.

The legacy Apple II DOS 3.3 file system used 256-byte physical sectors, and the Apple ProDOS and GS/OS operating systems used 512-byte blocks, each block containing 2 sectors.

Thus, I would argue that the terminology differs largely based on file system; some filesystem specifications may specify precise meanings for terms such as "block," "cluster" or "allocation unit." In Windows a "cluster" and an "allocation unit" may mean precisely the same thing, whereas in other filesystems the smallest unit directly addressable by the operating system may be referred to as a "block" and "allocation unit" may be a more generic term. The fact of some utilities and their documentation using the term "block" to mean something different than a file system "block" adds more ambiguity.

In short, Windows the fundamental allocation unit may be called a "cluster" or an "allocation unit," whereas in Unix-like systems the fundamental allocation unit is a "block," but "block" may also refer to an arbitrary "block" of data that is 512 bytes, 1024 bytes, or some multiple thereof that might or might not have anything to do with physical sectors. Sorry that this answer is not conclusive.

4232jl
  • 21
2

When talking about spinning disk media such as floppy and hard disks ...

"Spinning disk media" is an overly descriptive term. Solid State Drives and other mass-storage devices emulate HDDs, so some of these terms can be used in relation to these devices as well.


allocation unit

This is actually a filesystem (for random-access device) term rather than a disk or mass storage term.
The filesystem is what manages the storage device, and needs to maintain an accounting of what is in use (and by which file) and what is available.

For simplicity an allocation unit will consist of a fixed number of consecutively addressed, physical storage blocks, aka sectors. This provides a simple arithmetic translation between the allocation-unit number and the starting sector number (or LBA).
If the sectors (or LBAs) were not consecutively numbered, then each allocation unit would need its own sub-allocation list (which would be absurd).

As a filesystem term, this is a generic concept that transcends any implementation.
This term, in the form of of the acronym AU, is also used by the NAND Flash Translation layer in SD cards when used in video storage mode (as described in the SD Specifications, Part 1, Physical Layer Simplified Specification). In this situation the the NFTL is providing a filesystem-like service to emulate a sequential-access medium (like tape) using a random-access medium for recording video.


block

This is a word that has many meanings and uses in computer programming, computer hardware, and communications.
The meaning of "block" even when specifying a context such as in regards to disk drives is still ambiguous.
Without context and a qualifying descriptor or adjective preceding it, this word has no specific definition other than some grouping of bytes or data.

The Wikipedia article you cite tries to explain that the term 'block' has several meanings as a noun but is incomplete.
The article ignores the usage of 'block' for logical constructs, such as an arbitrary-sized logical block consisting of several LBAs, or allocating a block of memory (which is not defined by physical boundaries). For instance the Linux man page for malloc(3) mentions 'block' (of memory) 7 times.
The article has a redirect for the usage of 'block' as a verb relating to process scheduling, such as blocking (suspending) a process due to a pending I/O operation.

The ext4 reference cited in another answer is a perfect example of the multiple meanings/usage of the term 'block'.
In a specific context that document tries to convey that 'block' refers the unit of allocation for the ext4 filesystem.
But the word 'block' is still used for alternate meanings but qualified, such as the Super Block, and journal entries called Descriptor Block, Revocation Block, and Commit Block. The lengths of these 'blocks' are unrelated to the allocation 'block' size.

See also an old answer of mine on 'blocks'.


cluster

Because of the ubiquity of Microsoft operating systems and filesystems on PCs, the term cluster is widely understood to be a unit of allocation (for files).
Perhaps less understood is that this definition actually only applies to the FAT or NTFS filesystems.


granule

I'm not familiar with this term, but the reference you provide clearly states that this is the unit of allocation for files on diskette.


would "allocation unit" be the best umbrella term to be universally understood across platforms?

Yes.

sawdust
  • 18,591