Disambiguation: logical / physical block

filesystemshard drive

The terminology BLOCK confused me as I am doing some research about disk technology these days.


My Former Understanding

I understand BLOCK generally means a batch of data seen as a whole I/O unit, as described in the wiki page: Block. What I thought a logical block, or a filesystem block refers to is the minimal I/O unit seen as a whole used by specific filesystem, in order to, as the essence of any batch operation, reduce the overheads brought by reading or writing one sector one time. And a physical block is exactly the synonym of a disk sector. This article from Oracle confirmed my understanding.

What's more, I believe the word CLUSTER is just filesystem block in Microsoft's fashion, as suggested by this thread on Reddit.


What Confused Me

The wiki page: Logical Block Addressing I recently came across caused some confusion.

As the substitute for the CHS addressing, it seems that LBA should handle the same task as CHS did: give addresses to sectors, as suggested in this article. But I sense the reluctance of the LBA wiki page to use the word "sector", as well as from its title "Logical Block Addressing".

So, is LBA just a fancy word which actually concerns addressing disk sectors?

Or does LBA-compliant disks really understand the concept of filesystem/logical block, and is capable of making block-level I/O, thus hide the existence of "sector" from operating system?


Also, please correct me if any prerequisite of my question is misunderstood. Thanks.

Best Answer

I understand BLOCK generally means a batch of data seen as a whole I/O unit

The use of the term "block" is widespread in computing, and not restricted to I/O.

What I thought a logical block, or a filesystem block refers to is the minimal I/O unit seen as a whole used by specific filesystem, in order to, as the essence of any batch operation, reduce the overheads brought by reading or writing one sector one time.

IMO it would be careless to make sweeping definitions that encompass all filesystems. Be aware that the I/O blocksize for file data could be different from filesystem metadata. E.G. writes to a file could be consolidated into 4KB (or larger) blocks, but the filesystem journal may need to be written more often (with a smaller block) to ensure data retention.

"Batch operation" is old jargon, and you're using the term in a nonsensical manner.

And a physical block is exactly the synonym of a disk sector.

Only in the context of disk drives.
Magnetic tape requires I/O to be performed in physical blocks, but there is no concept of sectors with tape.

What's more, I believe the word CLUSTER is just filesystem block in Microsoft's fashion, as suggested by this thread on Reddit.

A "cluster" is a unit of allocation in MS filesystems.
Whether I/O is always performed in that same blocksize is questionable. E.G. When the cluster size is 64KB, and the entire file is just 128 bytes, is the filesystem going to write 128 sectors or optimize the I/O to just one sector?

So, is LBA just a fancy word which actually concerns addressing disk sectors?

Essentially yes (for legacy 512-byte sectors).

The integrated controller of the modern disk drive performs the mapping of LBA to physical sector. The actual cylinder, head, and sector that maps to a particular LBA is known only to the drive so that any type of zone-bit recording and relocation for bad sectors can be implemented by the disk drive.

With Advanced Format 512e HDDs that use 4096-byte sectors and a 512-byte transfer size, the term LBA is truly accurate: the address is not of a physical sector, but rather for a logical block consisting of an eighth of a sector.

Or does LBA-compliant disks really understand the concept of filesystem/logical block,

I'm not sure what you mean by "filesystem/logical block", but the answer is probably no.
It's simply a storage device with no concept of organizing the raw data it is storing.

See What kind of api does a sata hard-drive expose?

and is capable of making block-level I/O, thus hide the existence of "sector" from operating system?

The concept of sector (or physical block) cannot be eliminated, simply because that is the minimum unit of I/O. The lowest-levels of the OS (i.e. the device drivers) will always be cognizant of the hardware attributes. But each abstraction layer of the OS will try to obscure those details. So when you read a file, you may not know if it was retrieved from a HDD or DVD or over a network.

FWIW disk controllers (even old ones that used CHS addressing) can perform multi-sector read or write operations, e.g. perform a read of N sequential sectors.

Related Question