- Logical block addressing
Logical block addressing (LBA) is a common scheme used for specifying the location of blocks of data stored on
computer storage devices, generallysecondary storage systems such ashard disk s. 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 1024byte s each.ISO 9660 CDs (and images of them) use 2048-byte blocks.The LBA scheme
LBA is a particularly simple 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 atuple which defined the cylinder, head, and sector at which they appeared on thehard 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 successorExtended 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.
CHS to LBA conversion
C-H-S tuples can be converted to LBA addresses using the following formula:
LBA = (C * heads * spt) + (H * spt) + (S - 1)
LBA to CHS mapping
LBA addresses can be mapped to C-H-S tuples using the following formulae:
C = (LBA - S + 1) / (heads * spt) H = (LBA - S + 1) % (heads * spt) / spt S = LBA % spt + 1
(start by calculating 'S', as for simplicity it is used for calculating 'C' and 'H')
where - 'LBA' is the logical block address - 'heads' is the total number of logical heads - 'spt' is the number of logical sectors per track - '/' is the division operator and '%' is the
modulo operatorNote: the total number of cylinders does not enter into any calculation.
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 anMS-DOS volume (and aWindows 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 or 128 PiB, respectively, assuming the common 512 bytes per sector.
External links
* [http://www.dewassoc.com/kbase/hard_drives/lba.htm LBAs explained]
* [http://www.boot-us.com/gloss11.htm LBA and CHS format, LBA mapping]
* [http://support.microsoft.com/kb/q224526/ Microsoft article on 7.8GB limit on NT 4.0]
* [http://www.48bitlba.com/ 48bitLBA.com] Source for 48-bit LBA Information
* [http://www.dewassoc.com/kbase/hard_drives/drive_size_barrier_limitations_2.htm Hard Drive Size Limitations and Barriers]
Wikimedia Foundation. 2010.