Definition

logical block addressing (LBA)

What is logical block addressing (LBA)?

Logical block addressing (LBA) is a technique to specify the addresses of blocks of data on a storage device, such as a hard disk drives (HDDs). It is one of the defining features of Enhanced IDE (EIDE), a hard disk interface to the computer bus or data paths.

LBA is a simple linear addressing scheme to specify the locations of data blocks in storage devices to find these blocks or specified pieces of data. The term refers both to the address and the block to which it refers. The LBA technique first emerged in the early 1990s to support ATA/IDE drives. Most HDDs released since then implement LBA.

The earliest single LBA was a 22-bit value that was part of the earlier IDE standard. In 1994, the ATA-1 standard allowed for a 28-bit LBA that mapped to a specific cylinder, head and sector (CHS) address on the hard disk. These 28 bits allowed sufficient variation to specify addresses on an HDD with larger data storage capacities. Initially, LBA managed a hard drive addressable space of up to 8.4 gigabytes (GB). Since the release of ATA-6 in 2003, 48-bit LBA has also been available, which increases the addressing limit to 248 × 512 bytes or approximately 144 petabytes (PB).

How logical block addressing addresses cylinder, head and sector challenges

LBA is an alternative to early addressing schemes in which the physical details of a storage device were exposed to the operating system (OS). One such scheme is cylinder-head-sector or CHS block addressing, which assigns a specific valid range to each item: 0 to 1,023 for cylinders, 0 to 254 for heads and 1 to 63 for sectors.

In CHS, the addresses of physical blocks of data or sectors on a disk are exposed and addressing is done by identifying individual blocks by their position in a track. The track itself is determined by the numbers of the head and cylinder. Thus, to address a hard drive, its C, H and S addresses must be specified. The main problem with this scheme was that it did not work well with devices other than HDDs and cannot be used with them.

LBA supports many types of devices, including HDDs and secondary devices like tape and network storage. In this scheme, storage drives and their blocks of data are accessed by a single unique sector number instead of referring to a cylinder, head and sector. Existing blocks are counted from 0 and the storage device is addressed as a single device by linearly addressing all sectors.

In LBA, data blocks are located by an integer index. The first block is addressed as LBA 0, the second as LBA 1 and so on. Thus, as long as it is supported by the computer's OS, BIOS and HDD, LBA provides a simple addressing method compared to CHS. Consequently, it is now the dominant form of hard disk addressing.

diagram of how logical block addressing works
Example of a hard disk formatted using logical block addressing where the sectors are the same size.

Abstraction in logical block addressing

In SCSI hard drives, the LBA scheme was introduced as an abstraction. In this scenario, the CHS addresses of blocks of data on the hard disk are not exposed to the device driver, OS, file system code or applications that need to access the HDD. Any system calls that require block-level I/O pass the LBA definitions – for example, LBA 0 or LBA 1 -- to the device driver.

CHS to LBA mapping and conversion

Prior to 1996, many HDDs did not support LBA addressing, so they implemented a CHS translation or mapping scheme in the BIOS disk I/O routines. One scheme was the large method in which 16:4:8-bit ATA cylinders and heads would be remapped to other schemes used by disk access routines (e.g., INT 13h) to generate virtual drive heads and increase the practical limit of the drive.

However, this method creates portability problems since HDDs with a BIOS from one vendor cannot be read on a computer with a BIOS from a different vendor due to incompatible translation methods. One way to overcome this incompatibility problem is to use conversion software that replaces the normal routines at boot time with custom code, which enables LBA support for computers with non LBA-compliant BIOS.

In LBA, sector numbering starts with the first cylinder, first head and track's first sector. When the track -- the circular strips of sectors on the storage device -- is exhausted, numbering continues to the second head of the first cylinder. Once all 254 heads of the first cylinder are exhausted, numbering moves to the second cylinder, first head, track's first sector and so on.

In CHS, the combination of C, H and S is called a tuple. Also, use the following formula to determine local block addressing (i.e., a tuple):

LBA = sectors per head * current head + current sector number

When mapping CHS tuples to LBA addresses, the following equation comes into play:

LBA = (C x HPC) + H) x SPH + (S – 1)

In the above equation, C is equal to the cylinder number, HPC is the heads per cylinder, H is the head number, SPH is the sector per head and S is equal to the sector number.

Discover technologies and techniques to ease your data storage burden.

This was last updated in June 2023

Continue Reading About logical block addressing (LBA)