Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Logical block addressing
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Way to specify the location of data on computer storage devices}} <!-- {{anchor|LBA21|LBA32}} --> '''Logical block addressing''' ('''LBA''') is a common scheme used for specifying the location of [[Block (data storage)|blocks of data]] stored on [[computer storage]] devices, generally [[secondary storage]] systems such as [[hard disk drive]]s. LBA is a particularly simple [[linear addressing]] scheme; blocks are located by an integer index, with the first block being LBA 0, the second LBA 1, and so on.<ref>{{Cite web |title=What is logical block addressing (LBA)? {{!}} Definition from TechTarget |url=https://www.techtarget.com/whatis/definition/logical-block-addressing-LBA#:~:text=Logical%20block%20addressing%20(LBA)%20is,computer%20bus%20or%20data%20paths. |access-date=2025-03-22 |website=WhatIs |language=en}}</ref> The [[Parallel ATA|IDE]] standard included 22-bit LBA as an option, which was further extended to 28-bit with the release of ATA-1 (1994) and to 48-bit with the release of ATA-6 (2003), whereas the size of entries in on-disk and in-memory data structures holding the address is typically 32 or 64 bits. Most hard disk drives released after 1996 implement logical block addressing. ==Overview== {{See also|Fixed-block architecture}} In logical block addressing, only one number is used to address data, and each linear base address describes a single block. 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 did not 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 [[Modified Frequency Modulation|MFM]] and [[Run Length Limited|RLL]] drives, and both it and its successor, extended cylinder-head-sector (ECHS), were used in the first [[Advanced Technology Attachment|ATA]] drives. However, current disk drives use [[zone bit recording]], where the number of sectors per track depends on the track number. Even though the disk drive will report some CHS values as sectors per track (SPT) and heads per cylinder (HPC), they have little to do with the disk drive's true geometry. LBA was first introduced in 1981 by [[Shugart Associates System Interface|SASI]], the precursor of [[SCSI]], 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. In [[redundant array of independent disks]] (RAID) devices and [[storage area network]]s (SANs) and where logical drives ([[logical unit number]]s, LUNs) are composed via LUN virtualization and aggregation, LBA addressing of individual disk should be translated by a software layer to provide uniform LBA addressing for the entire storage device. == {{anchor|LBA22|LBA28}}Enhanced BIOS == {{See also|INT 13h}} The earlier IDE standard from Western Digital introduced 22-bit LBA; in 1994, the [[AT Attachment|ATA-1 standard]] allowed for 28 bit addresses in both LBA and CHS modes. The CHS scheme used 16 bits for cylinder, 4 bits for head and 8 bits for sector, counting sectors from 1 to 255. This means the reported number of heads never exceeds 16 (0β15), the number of sectors can be 255 (1β255; though 63 is often the largest used) and the number of cylinders can be as large as 65,536 (0β65535), limiting disk size to 128 GiB (β137.4 GB), assuming 512 byte sectors. These values can be accessed by issuing the ATA command "Identify Device" (<code>EC</code>h) to the drive.<ref name="Working Draft of ATA/ATAPI-5">{{cite web |url=http://www.t13.org/documents/UploadedDocuments/project/d1321r3-ATA-ATAPI-5.pdf |title=Information Technology - AT Attachment with Packet Interface - 5 (ATA/ATAPI-5) |website=[[International Committee for Information Technology Standards|www.t13.org]] |date=29 February 2000 |access-date=15 December 2020 |archive-url=https://web.archive.org/web/20200806062242/https://www.t13.org/documents/UploadedDocuments/project/d1321r3-ATA-ATAPI-5.pdf |archive-date=6 August 2020}}</ref>{{rp|87|q=Section 8.12 - IDENTIFY DEVICE}} However, the [[IBM BIOS]] implementation defined in the [[INT 13h]] disk access routines used quite a different 24-bit scheme for CHS addressing, with 10 bits for cylinder, 8 bits for head, and 6 bits for sector, or 1024 cylinders, 256 heads, and 63 sectors.<ref>{{cite web|url=http://support.microsoft.com/kb/q224526/en-us |title=KB224526: Windows NT 4.0 supports maximum of 7.8-GB system partition |publisher=Support.microsoft.com |date=2007-02-23 |access-date=2013-07-30}}</ref> This INT 13h implementation had pre-dated the ATA standard, as it was introduced when the [[IBM PC]] had only [[floppy disk]] storage, and when hard disk drives were introduced on the [[IBM PC/XT]], INT 13h interface could not be practically redesigned due to [[backward compatibility]] issues. Overlapping ATA CHS mapping with BIOS CHS mapping produced the lowest common denominator of 10:4:6 bits, or 1024 cylinders, 16 heads, and 63 sectors, which gave the practical limit of 1024Γ16Γ63 sectors and 528{{nbsp}}MB (504 [[MiB]]), assuming 512 byte sectors. In order for the BIOS to overcome this limit and successfully work with larger hard drives, a CHS translation scheme had to be implemented{{when|date=November 2023}} in the BIOS disk I/O routines which would convert between 24-bit CHS used by INT 13h and 28-bit CHS numbering used by ATA. The translation scheme was called ''large'' or ''bit shift translation''. This method would remap 16:4:8 bit ATA cylinders and heads to 10:8:6 bit scheme used by INT 13h, generating much more "virtual" drive heads than the physical disk reported. This increased the practical limit to 1024Γ256Γ63 sectors, or 8.4{{nbsp}}GB (7.8 [[Gibibyte|GiB]]). To further overcome this limit, [[INT 13h Extensions]] were introduced{{when|date=November 2023}} with the ''[[BIOS Enhanced Disk Drive Services]]'', which removed practical limits on disk size for operating systems which are aware of this new interface, such as the ''DOS 7.0'' component in [[Windows 95]]. This ''enhanced BIOS'' subsystem supports LBA addressing with ''LBA'' or ''[[#LBA assist|LBA-assisted]]'' method, which uses native 28-bit LBA for addressing ATA disks and performs CHS conversion as needed. The ''normal'' or ''none'' method reverts to the earlier 10:4:6 bit CHS mode which does not support addressing more than 528{{nbsp}}MB. {{Anchor|EZ-DRIVE|EZ-BIOS}} [[File:Installation of the Western Digital's EZ Drive, on a 3.5-inch floppy disk.jpg|thumb|Installation of Western Digital's OEM-version of ''EZ Drive'', on a 3.5-inch floppy disk.]] Until the release of ATA-2 standard in 1996, there were a handful of large hard drives which did not support LBA addressing, so only ''large'' or ''normal'' methods could be used. However, using the ''large'' method also introduced portability problems, as different BIOSes often used different and incompatible translation methods, and hard drives partitioned on a computer with a BIOS from a particular vendor often could not be read on a computer with a different make of BIOS. The solution was to use conversion software such as [[Disk Manager|OnTrack Disk Manager]], Micro House<!-- International --> EZ-Drive/EZ-BIOS, etc., which installed to the disk's [[Master Boot Record|OS loader]] and replaced INT 13h routines at boot time with custom code. This software could also enable LBA and INT 13h Extensions support for older computers with non LBA-compliant BIOSes. === {{anchor|LBA assist}}LBA-assisted translation === When the BIOS is configured to use a disk in LBA-assisted translation mode, the BIOS accesses the hardware using LBA mode, but also presents a translated CHS geometry via the INT 13h interface. The number of cylinders, heads, and sectors in the translated geometry depends on the total size of the disk, as shown in the following table.<ref>{{cite web|last=Steunebrink |first=Jan |title=The BIOS IDE Harddisk Limitations |url=http://web.inter.nl.net/hcc/J.Steunebrink/bioslim.htm#LBA |access-date=6 October 2013 |archive-url=https://archive.today/20131006092656/http://web.inter.nl.net/hcc/J.Steunebrink/bioslim.htm |archive-date=6 October 2013 |url-status=dead }}</ref> {| class="wikitable" |- ! Disk size !! Sectors/track !! Heads !! Cylinders |- | {{nowrap|1 < X β€ 504 MiB}} || 63 || 16 || {{nowrap|X Γ· (63 Γ 16 Γ 512)}} |- | {{nowrap|504 MiB < X β€ 1008 MiB}} || 63 || 32 || {{nowrap|X Γ· (63 Γ 32 Γ 512)}} |- | {{nowrap|1008 MiB < X β€ 2016 MiB}} || 63 || 64 || {{nowrap|X Γ· (63 Γ 64 Γ 512)}} |- | {{nowrap|2016 MiB < X β€ 4032 MiB}} || 63 || 128 || {{nowrap|X Γ· (63 Γ 128 Γ 512)}} |- | {{nowrap|4032 MiB < X β€ 8032.5 MiB}} || 63 || 255 || {{nowrap|X Γ· (63 Γ 255 Γ 512)}} |} ==={{anchor|LBA64}}LBA48=== The current 48-bit LBA scheme was introduced in 2002 with the [[ATA-6]] standard,<ref>{{cite web |url=http://www.t13.org/Documents/UploadedDocuments/project/d1410r3b-ATA-ATAPI-6.pdf|title=Information Technology - AT Attachment with Packet Interface - 6 (ATA/ATAPI-6) |website=[[International Committee for Information Technology Standards|www.t13.org]] |date=26 February 2002 |access-date=15 December 2020 |archive-url=https://web.archive.org/web/20200806032447/https://t13.org/Documents/UploadedDocuments/project/d1410r3b-ATA-ATAPI-6.pdf |archive-date=6 August 2020}}</ref> raising the addressing limit to 2{{sup|48}}{{nbsp}}Γ 512 bytes, which is exactly 128{{nbsp}}[[Pebibyte|PiB]] or approximately 144{{nbsp}}[[Petabyte|PB]]. Current PC-compatible computers support INT 13h Extensions, which use 64-bit structures for LBA addressing and should encompass any future extension of LBA addressing, though modern operating systems implement direct disk access and do not use the [[BIOS]] subsystems, except at [[boot loader|boot load]] time. Disks partitioned with [[Master boot record|MBR]] use 32-bit logical block addressing LBA to handle the total number of physical or logical sectors, that is, they can handle a total maximum of 4,294,967,296 sectors (2^32). This means that traditionally a maximum data limit of 2 [[tebibyte]]s could be stored per hard disk, since these have a physical and logical sector size of 512 bytes. This limit can be exceeded up to 16 TiB with a physical and logical sector of 4096 bytes.<ref>{{cite web|url=https://goughlui.com/2013/10/02/experiment-usb-to-sata-bridge-chips-and-2tb-drives|title=USB to SATA bridge chips and +2Tb drives|accessdate=January 26, 2025|language=English}}</ref> ==CHS conversion== {| class="wikitable floatright" style="margin-left: 1.5em;" |+ LBA and CHS equivalence with 16 heads per cylinder |- ! LBA value !! CHS tuple |- | style="text-align: right; padding-right: 0.5em;"| 0 | style="text-align: center" | 0, 0, 1 |- | style="text-align: right; padding-right: 0.5em;"| 1 | style="text-align: center" | 0, 0, 2 |- | style="text-align: right; padding-right: 0.5em;"| 2 | style="text-align: center" | 0, 0, 3 |- | style="text-align: right; padding-right: 0.5em;"| 62 | style="text-align: center" | 0, 0, 63 |- | style="text-align: right; padding-right: 0.5em;"| 63 | style="text-align: center" | 0, 1, 1 |- | style="text-align: right; padding-right: 0.5em;"| 945 | style="text-align: center" | 0, 15, 1 |- | style="text-align: right; padding-right: 0.5em;"| 1007 | style="text-align: center" | 0, 15, 63 |- | style="text-align: right; padding-right: 0.5em;"| 1008 | style="text-align: center" | 1, 0, 1 |- | style="text-align: right; padding-right: 0.5em;"| 1070 | style="text-align: center" | 1, 0, 63 |- | style="text-align: right; padding-right: 0.5em;"| 1071 | style="text-align: center" | 1, 1, 1 |- | style="text-align: right; padding-right: 0.5em;"| 1133 | style="text-align: center" | 1, 1, 63 |- | style="text-align: right; padding-right: 0.5em;"| 1134 | style="text-align: center" | 1, 2, 1 |- | style="text-align: right; padding-right: 0.5em;"| 2015 | style="text-align: center" | 1, 15, 63 |- | style="text-align: right; padding-right: 0.5em;"| 2016 | style="text-align: center" | 2, 0, 1 |- | style="text-align: right; padding-right: 0.5em;"| 16,127 | style="text-align: center" | 15, 15, 63 |- | style="text-align: right; padding-right: 0.5em;"| 16,128 | style="text-align: center" | 16, 0, 1 |- | style="text-align: right; padding-right: 0.5em;"| 32,255 | style="text-align: center" | 31, 15, 63 |- | style="text-align: right; padding-right: 0.5em;"| 32,256 | style="text-align: center" | 32, 0, 1 |- | style="text-align: right; padding-right: 0.5em;"| 16,450,559 | style="text-align: center" | 16319, 15, 63 |- | style="text-align: right; padding-right: 0.5em;"| 16,514,063 | style="text-align: center" | 16382, 15, 63 |} In the LBA addressing scheme, sectors are numbered as integer indexes; when mapped to CHS ([[cylinder-head-sector]]) [[tuple]]s, LBA numbering starts with the first cylinder, first head, and track's first sector. Once the track is exhausted, numbering continues to the second head, while staying inside the first cylinder. Once all heads inside the first cylinder are exhausted, numbering continues from the second cylinder, etc. Thus, the lower the LBA value is, the closer the physical sector is to the hard drive's first (that is, outermost<ref>{{cite web | url = http://www.active-undelete.com/hdd_basic.htm | title = Hard Disk Drive Basics | access-date = 2015-02-10 | website = active-undelete.com | quote = Track numbers start at 0, and track 0 is the outermost track of the disk. The highest numbered track is next to the spindle. }}</ref>) cylinder. CHS tuples can be mapped to LBA address with the following formula:<ref>{{cite web | url = http://www.tldp.org/HOWTO/Large-Disk-HOWTO-3.html | title = Large Disk HOWTO, Section 3. Disk Access | date = 2004-11-08 | access-date = 2015-02-10 | website = tldp.org }}</ref><ref>{{cite web | url = http://pcrepairclass.tripod.com/cgi-bin/datarec1/chstolba.html | title = The CHS to LBA Conversion Formulas | access-date = 2014-08-26 | website = pcrepairclass.tripod.com }}</ref> : ''LBA'' = (''C'' Γ ''HPC'' + ''H'') Γ ''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 maximum number of heads per cylinder (reported by disk drive, typically 16 for 28-bit LBA) * ''SPT'' is the maximum number of sectors per track (reported by disk drive, typically 63 for 28-bit LBA) LBA addresses can be mapped to CHS tuples with the following formula ("mod" is the [[modulo operation]], i.e. the [[remainder]], and "Γ·" is [[integer division]], i.e. the [[quotient]] of the division where any fractional part is discarded): : ''C'' = ''LBA'' Γ· (''HPC'' Γ ''SPT'') : ''H'' = (''LBA'' Γ· ''SPT'') mod ''HPC'' : ''S'' = (''LBA'' mod ''SPT'') + 1 According to the ATA specifications, "If the content of words (61:60) is greater than or equal to 16,514,064, then the content of word 1 [the number of logical cylinders] shall be equal to 16,383."<ref name="Working Draft of ATA/ATAPI-5"/>{{rp|20|q=Section 6.2.1 - Definitions and value ranges of IDENTIFY DEVICE words}} Therefore, for LBA 16450559, an ATA drive may actually respond with the CHS ''tuple'' (16319, 15, 63), and the number of cylinders in this scheme must be much larger than 1024 allowed by INT 13h.{{Efn|Though CHS addressing definitely uses the mathematical concept of ''[[tuple]]'', it may also be considered an example of the general scheme called [[mixed radix]] by viewing its cylinders, heads and sectors as having different numerical bases; e.g., cylinders counting from 0 to 1023, heads from 0 to 254 and sectors from 1 to 63.}} ===Operating system dependencies=== {{Unreferenced section|date=June 2024}} Operating systems that are sensitive to BIOS-reported drive geometry include [[Solaris (operating system)|Solaris]], [[DOS]] and Windows NT family, where [[NTLDR]] ([[Windows NT|NT]], [[Windows 2000|2000]], [[Windows XP|XP]], [[Windows Server 2003|Server 2003]]) or [[Windows Boot Manager|BOOTMGR]] ([[Windows Vista|Vista]], [[Windows Server 2008|Server 2008]], [[Windows 7]] and [[Windows Server 2008 R2|Server 2008 R2]]) use [[Master boot record]] which addresses the disk using CHS; [[x86-64]] and [[Itanium]] versions of Windows can partition the drive with [[GUID Partition Table]] which uses LBA addressing. Some operating systems do not require any translation because they do not use geometry reported by BIOS in their [[boot loader]]s. Among these operating systems are [[BSD]], [[Linux]], [[macOS]], [[OS/2]] and [[ReactOS]]. == See also == * [[Block (data storage)]] * [[Cylinder-head-sector]] (CHS) * [[Disk formatting]] * [[Disk partitioning]] * [[Disk storage]] == Notes == {{Notelist}} ==References== {{Reflist}} ==External links== * [http://www.dewassoc.com/kbase/hard_drives/lba.htm LBAs explained] {{Webarchive|url=https://web.archive.org/web/20210225074751/http://www.dewassoc.com/kbase/hard_drives/lba.htm |date=2021-02-25 }} * [http://www.boot-us.com/gloss11.htm LBA and CHS format, LBA mapping] * [http://viralpatel.net/taj/tutorial/chs_translation.php CHS to LBA Translation Tutorial] * [http://support.microsoft.com/kb/q224526/ Microsoft article on 7.8 GB limit on NT 4.0] * [http://www.dewassoc.com/kbase/hard_drives/drive_size_barrier_limitations_2.htm Hard Drive Size Limitations and Barriers] {{Webarchive|url=https://web.archive.org/web/20210225073301/http://www.dewassoc.com/kbase/hard_drives/drive_size_barrier_limitations_2.htm |date=2021-02-25 }} * [https://books.google.com/books?id=E1p2FDL7P5QC&dq=bit+shifting+lba&pg=RA1-PA527 Upgrading and Repairing PC's], by Scott Mueller. Pages 524β531. * [https://web.archive.org/web/20200806025823/http://www.t13.org/Documents/UploadedDocuments/docs2008/D1699r6a-ATA8-ACS.pdf AT Attachment 8 - ATA/ATAPI Command Set (ATA8-ACS)] {{DEFAULTSORT:Logical block addressing}} [[Category:Computer storage devices]] [[Category:SCSI]] [[Category:AT Attachment]] [[Category:BIOS]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Anchor
(
edit
)
Template:Cite web
(
edit
)
Template:Efn
(
edit
)
Template:Nbsp
(
edit
)
Template:Notelist
(
edit
)
Template:Nowrap
(
edit
)
Template:Reflist
(
edit
)
Template:Rp
(
edit
)
Template:See also
(
edit
)
Template:Short description
(
edit
)
Template:Sup
(
edit
)
Template:Unreferenced section
(
edit
)
Template:Webarchive
(
edit
)
Template:When
(
edit
)