Share on Facebook Share on Twitter Email
Answers.com

Logical block addressing

 

(Logical Block Addressing) A method used to address hard disks by a single sector number rather than by cylinder, head and sector (CHS). LBA was introduced to support ATA/IDE drives as they reached 504MB, and Enhanced BIOSs in the PC translated CHS addressing into LBA addressing. Subsequent ATA specifications raised support to 8.4GB, 128GB and 128PB (petabytes), the latter capacity we hope never to reach on our home PC in many lifetimes.

Download Computer Desktop Encyclopedia to your iPhone/iTouch

Search unanswered questions...
Enter a question here...
Search: All sources Community Q&A Reference topics
Wikipedia: Logical block addressing
Top

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. ISO 9660 CDs (and images of them) use 2048-byte blocks.

Contents

The LBA scheme

LBA is a particularly simple linear addressing scheme; blocks are 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 both 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, or 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.

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.

Conversion between CHS to LBA

CHS addresses can be converted to LBA addresses using the following formula,

LBA=((C \times HPC) + H ) \times SPT + S -1

where,

  • C, H and S are the cylinder number, the head number, and the sector number
  • LBA is the logical block address
  • HPC is the number of heads per cylinder
  • SPT is the number of sectors per track

LBA addresses can be mapped to CHS address using the following formulae:

\begin{align}
S &= ( LBA \, \bmod \, SPT ) + 1 \\
H &= ( LBA \div SPT ) \, \bmod \, HPC \\
C &= LBA \div ( SPT \times HPC )
\end{align}

where

  • mod is the modulo operation, i.e. the remainder, and
  • \div is integer division, i.e. the quotient of the division.

However, note that current disk drives use Zone Bit Recording, where the number of sectors per track depends on the track number. The disk drive will report a SPT to provide for these calculations, but which has little to do with the disk drive's true geometry.

Another formula:

LBA / spt = Result1 + Remainder1
        S = Remainder1 + 1
Result1 / heads = Result2 + Remainder2
        C = Result2
        H = Remainder2

Example:

CHS = (600, 10, 84). Finding CHS for LBA = 1234 would be:

1234 / 84 = 14 R 58
        S = 58 + 1 = 59
14 / 10 = 1 R 4
        C = 1
        H = 4
CHS = (1, 4, 59)

Test: ((1 * 10) + 4) * 84 + 59 - 1 = 14 * 84 + 58 = 1234

LBA, ATA devices and Enhanced BIOS

The first formal definition of the ATA standard interface allowed for 28 bit block addresses, using either LBA or CHS . The CHS mode used the 28 bits as follows: 16 bits of cylinder, 4 bits of head and 8 bits of sector. Note that CHS schemes count sectors from 1. Therefore the maximum number of sectors is 255 by this standard.

At the time of ATA-1 introduction, the BIOS standard for CHS was 24 bits, with 10 bits cylinder, 8 bits head, and 6 bits sector. This was defined by the BIOS INT 13H routine, and is used in the DOS style Master Boot Record. This created a need for translation between BIOS CHS and ATA CHS numbering, else only the least common denominator of 10/4/6 bits of CHS (respectively) could be used, or 1024*16*63 sectors for a limit of 504 MiB, assuming 512 byte sectors. Translation methods include the Large or Enhanced BIOS (also called Bit Shift Translation) which remapped the reported number of cylinders and heads, but left the sector numbers alone, and LBA-assist, which converted between the CHS systems by mapping first to LBA addressing.

At best, the 10/8/6 scheme of the BIOS meant an MS-DOS volume (and a Windows NT 4.0 system partition) was limited to 7.8 GiB, even given these methods of translation. The ATA-1 standard of 28 bit LBA limits disks to 128 GiB, assuming 512 byte sectors. In 2002 ATA-6 introduced the 48 bit LBA, extending the possible disk sizes to 128 PiB, assuming 512 byte sectors.

See also

External links


 
 

 

Copyrights:

Computer Desktop Encyclopedia. THIS DEFINITION IS FOR PERSONAL USE ONLY.
All other reproduction is strictly prohibited without permission from the publisher.
© 1981-2010 The Computer Language Company Inc.  All rights reserved.  Read more
Wikipedia. This article is licensed under the Creative Commons Attribution/Share-Alike License. It uses material from the Wikipedia article "Logical block addressing" Read more