Logical block addressing

From Wikipedia, the free encyclopedia

Logical block addressing (LBA) is a common scheme used for specifying the location of blocks of data stored on computer storage devices, generally secondary storage systems such as hard disks. The term LBA can mean either the address or the block to which it refers. Logical blocks in modern computer systems are typically 512 or 1024 bytes each. ISO9660 CDs (and images of them) use 2048-byte blocks.

Contents

[edit] Visual Example

LBA gives BIOSs a common way to address sectors. LBA doesn't work with sector per track, cylinders and heads, but it uses logical sector numbers. LBA can support drives to 128 GB.

A BIOS in combination with LBA

Here the cylinder number can be above 1024: A BIOS without LBA

LBA must be supported by the drive and BIOS, as most BIOSs which support LBA will also support drives above 504MB (XCHS), it looks like LBA shifted the limit. Unfortunately the same BIOSs introduces the 8GB limit which significantly reduces the LBA addressing capacity.

[edit] More Information

LBA is a run-time function of the system BIOS. The BIOS uses LBA for the following commands: read (with and without retries), read verify, read long, write (with and without retries), write verify, write long, read multiple, write multiple, read DMA, write DMA, seek, and format track.

As with non-LBA systems, information about the hard disk's true geometry is stored in the system CMOS. When reporting information about the hard disk to MS-DOS, however, a system employing LBA essentially depicts a hard disk with fewer than 1024 cylinders and the LBA BIOS performs a translation from the MS-DOS track, head, and sector to logical block numbers used by the drive, allowing the entire disk to be used without special drivers or third- party disk utilities.

The LBA standard specifies the following two types of drive parameter tables:

  • Automatic (recommended for Novell NetWare and Unix).
  • Translation (recommended for MS-DOS, Windows, OS/2 2.x, and Windows NT).

The following sections provide information about the use of LBA with various BIOS chip sets, including the specific versions of these BIOS chip sets that support LBA.

Also see Logical Block Addressing (LBA) Defined from Microsoft Windows.

[edit] The LBA scheme

LBA is a particularly simple addressing scheme; blocks are simply located by an index, with the first block being LBA=0, the second LBA=1, and so on. The LBA scheme replaces earlier schemes which exposed the physical details of the storage device to the software of the operating system. Chief among these was the cylinder-head-sector (CHS) scheme, where blocks were addressed by means of a tuple which defined the cylinder, head, and sector at which they appeared on the hard disk. CHS didn't map well to devices other than hard disks (such as tapes and networked storage), and was generally not used for them. CHS was used in early MFM and RLL drives, and it and its successor Extended Cylinder-Head-Sector (ECHS) were used in the first ATA drives.

SCSI introduced LBA as an abstraction. While the drive controller still addresses data blocks by their CHS address, this information is generally not used by the SCSI device driver, the OS, filesystem code, and any applications (such as databases) that access the "raw" disk. System calls requiring block-level I/O pass LBA definitions to the storage device driver; for simple cases (where one volume maps to one physical drive), this LBA is then passed directly to the drive controller.

[edit] LBA mapping and LUN virtualization

For more complex cases (particularly RAID devices and SANs and where logical drives (LUNs) are composed via LUN virtualization and aggregation), LBAs are translated from the application's model of the disk to that used by the actual storage device. In complex deployments, particularly when a storage fabric is employed, several of these LBA translations may occur between the dispatching application and the final, remote, disk.

[edit] LBA, ATA devices and Enhanced BIOS

The first formal definition of the ATA interface inherited the CHS scheme from earlier drive standards. This proved to be a limiting factor as ATA drives grew. Originally cylinder, head, and sector were limited to 1024, 16, and 63 respectively. Later, more advanced BIOS implementations (known sometimes as Enhanced BIOS) that virtualised the CHS mapping (often generating many more "virtual" drive heads than the physical disk really possessed) expanded this limit to 1024, 255, and 63. This meant an MS-DOS volume (and a Windows NT 4.0 system partition) was limited to 7.8 GiB.

The second ATA standard (ATA-2) introduced an LBA mode of operation, which has subsequently become the most commonly used scheme when communicating with ATA drives and their technical successors. LBA addresses in ATA can be 28-bit or 48-bit (introduced in ATA-6) wide, which results in a disk size limit of 128 GiB and 128 PiB, respectively, assuming the common 512 bytes per sector.

[edit] External links