Logical block addressing
The logical block addressing, in English logical block addressing (LBA), is a very common method used to specify the location of the blocks of data in storage systems, primarily the secondary storage of a computer. The term LBA can also refer to the "address of the block" to which it links.
Logic blocks in modern computers are typically 512 or 1024 bytes each.
Operation
LBA is a particularly simple addressing method. The blocks are numbered according to an index, the first block being: LBA 0, the second: LBA 1, and so on.
This method succeeds previous systems that exposed the physical details of storage units directly to software, with the risks that this entails. The pioneer of these systems was Cylinder-Head-Sector (cylinder-head-sector or CHS), where an address was assigned to each block by means of a tuple that defined the cylinder, the head and the sector in which it was located. This system did not work well on devices other than hard drives, such as magnetic tapes, so it was not widely used in those cases. The CHS system debuted on the RLL and MFM units. The CHS and its successor, the Extended Cylinder-Head-Sector (ECHS), were used in early Integrated Drive Electronics (IDE).
SCSI introduced LBA as an abstraction. Although the drive controller still uses CHS to access the blocks, this information is not used by the driver, the operating system, or any other application that accesses the disk at a low level. In cases where the software absolutely needs block-level access, LBA addresses passed to the drive controller are used.
For more complex cases, such as RAID and SAN (Storage Area Network) drives, the drive directly translates the LBA addresses of the model used by the software application, to the model used by the unit.
LBA, ATA Devices and Enhanced BIOS
The first ATA interface specification inherited the CHS scheme from the IBM-PC (1981) for obvious compatibility reasons. More exactly, from the BIOS INT 13h specification. This turned out to be a negative factor due to the inexorable growth of the units and the inevitable CHS limitation.
Originally, and until today (obsolete), the CHS system worked in 24 bits (3 bytes) and addressed using a curious distribution of bits. 10 for cylinders, 8 for heads, and 6 for sectors (1024, 256, 63) while the ATA specification addressed in 28 bits, 16 for cylinders, 4 for heads, and 8 for sectors (65,536, 16, 255). The CHS-ATA union (IBM PC plus ATA disk) was limited to the smallest values of this union. So you could get a maximum of (1024-16-63) by limiting addressing to just 504 MiB of the 7.8 GiB actually offered by CHS and much further than the 128 GiB of ATA drives. Later, the appearance of improved BIOSes led to the adaptation of the CHS system, called large or enhanced CHS (ECHS) using an algorithm that adapted the geometry of the disk ATA to CHS. This divided the number of cylinders on the disk by powers of two (2, 4, 8...) and multiplied the heads by the same factor. If the result was within the maximum CHS values, it was used by the BIOS to access the disk. This allowed ATA drives smaller than 7.8 GiB to be CHS-addressable. Thus, the disks were limited to this value of 7.875 GiB (1024 cylinders x 256 heads x 63 sectors x 512 bytes/sector).
The second standard introduced a mode of operation with LBA, which over time has become the most widely used system for communicating with ATA drives and their successors. LBA addressing on ATA drives can be either 28-bit or 48-bit (introduced in ATA-6), resulting in limits of 128 GiB (2^28 sectors x 512 bytes per sector) and 128 PiB (2^48 x 512 bytes per sector).
Disks formatted in MBR can address a minimum limit of 2 tebibytes if the cluster format is done in the traditional size of 512 bytes (32-bit system).
Cluster of 512
2^32x512= 2 TiB limit
However currently the minimum cluster format size is usually 4 KiB to match the physical space in which hard drives are now manufactured, resulting in a minimum space limit of 16 tebibytes for hard drives formatted in MBR.
Cluster of 4096
2^32x4096= 16 TiB limit
In other cluster formats on MBR disks the following limits can be reached, for example:
Cluster of 65536
2^32x65536= 256 TiB limit
These references are valid at least for traditional Windows formats, both FAT32 and NTFS.
In addition, in the exFAT format it can be formatted with a size of 131072 bytes
Cluster of 131072 bytes
2^32x131072= 512 TiB limit
These limits can be overcome by formatting in GPT which uses 64 bits (instead of MBR's 32 bits), going up to 9.4 ZiB.
Note 1: Not all Windows operating systems are capable of addressing 48-bit LBA on MBR hard drives and exceeding the 2 TiB limit. The feature was implemented in the NT 5 version (2000 SP2 - XP SP1 - 2003). Not having been initially enabled in later versions of NT 6 (Vista - 7 - 8 - 8.1) until receiving the latest updates, so if data were stored on MBR hard drives with partitions larger than 2 TiB in earlier or later versions of Windows would be unreadable for an NT 6 without updating. Windows NT 10 was given the capability early on. Modern Linux distributions can perfectly read hard drives larger than 2 TiB formatted in MBR (since 2008 approx.)
Note 2: The CHS value 63 (1024, 256, 63) corresponds to zero sector removal, which is not allowed in CHS. Thus, for example, from the sector (126,255,63) we go to (127,0,1). In this way there is not a maximum of 64 (2^6) sectors, but 63 (2^6 - 1). Also for this reason the conversion algorithm to LBA ends with:
- ... + sector-1
Contenido relacionado
GM-NAA I/O
Kilobit per second
PHP nuke
DirectX
Clipper (programming language)