Logical block addressing
2009-02-23 22:04
204 查看
quoted from
http://en.wikipedia.org/wiki/Logical_block_addressing
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 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.
CHS to LBA conversion
C-H-S tuples can be converted to LBA addresses using the following formula:
LBA to CHS mapping
LBA addresses can be mapped to C-H-S tuples using the following formulae:
(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
sectors_per_track is the number of logical sectors per track
mod is the modulo operator
Note: the total number of cylinders does not enter into any calculation.
Another formula:
Example:
http://en.wikipedia.org/wiki/Logical_block_addressing
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 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.
CHS to LBA conversion
C-H-S tuples can be converted to LBA addresses using the following formula:
LBA to CHS mapping
LBA addresses can be mapped to C-H-S tuples using the following formulae:
(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
sectors_per_track is the number of logical sectors per track
mod is the modulo operator
Note: the total number of cylinders does not enter into any calculation.
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
相关文章推荐
- error:unable to get logical block size for spfile
- 再议O_DIRECT, O_DIRECT与logical_block_size
- Physical read + Logical read(DB block gets ,consistent gets )
- Linux中的physical_block_size和logical_block_size
- 关于Oracle asmlib配置文件中的ORACLEASM_USE_LOGICAL_BLOCK_SIZE参数:
- ORA-27046: file size is not a multiple of logical block size
- Physical and Logical Block Corruptions. All you wanted to know about it. (Doc ID 840978.1)
- Physical and Logical Block Corruptions. All you wanted to know about it. (文档 ID 840978.1)
- ORA-27046: file size is not a multiple of logical block size
- ERROR:NgdBuild:604 - logical block 'Inst_edksub/proc_sys_reset_0' with type 'proc
- inline-block 前世今生
- Block(二)内存管理与其他特性-b
- Overview of Logical Database Structures
- block(八)作用域
- block 和 inline 的区别是什么
- error: cannot allocate memory in static TLS block
- ios中block简单用法
- 从反汇编看Block的实质
- 重新想象 Windows 8 Store Apps (1) - 控件之文本控件: TextBlock, TextBox, PasswordBox, RichEditBox, RichTextBlock, RichTextBlockOverflow
- javascript 控制 table tr display block 显示模式时,只对第一个单元格有效