Partition TableMaster Boot Record: Logical Block Addressing (LBA)


Partition Table/Master Boot Record: Logical Block Addressing (LBA)

As mentioned earlier, LBA is the other method for addressing large-capacity drives. Despite being armed with primary partitions, logical partitions, and optional flag sets for partitions, we still cannot adequately address large-capacity drives using the CHS scheme. Using the LBA model addresses this limitation and allows for very large drives to be defined. In the following example, note that the values defined for the ending CHS do not have the capability to mark the end of the partition.

nc6000:/burn # cfdisk -P rst /dev/sda Disk Drive: /dev/sda Sector 0: 0x000: 33 C0 8E D0 BC 00 7C FB 50 07 50 1F FC BE 1B 7C ~~~~Skipped to save space~~~~ 0x1B0: 00 00 00 00 00 00 00 00 2C 88 3E 6F CF C9 00 01 0x1C0: 01 00 0C FE FF FF 3F 00 00 00 82 91 A8 04 00 00 0x1D0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1E0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 AA Partition Table for /dev/sda                First       Last  # Type        Sector     Sector   Offset    Length   Filesystem Type (ID) Flag -- ------- ----------- ---------- ------ --------- ------------ ------- 1 Primary          0  78156224    63   78156225 W95 FAT32 (LBA) (0C) None   Pri/Log   78156225  80292869     0    2136645 Free Space           None Partition Table for /dev/sda          ---Starting---       ----Ending----   Start     Number of  # Flags Head Sect Cyl   ID   Head Sect Cyl    Sector    Sectors -- ----- ---- ---- ---- ---- ---- ---- ---- ----------- -----------  1 0x00     1    1    0 0x0C  254   63 1023          63    78156162


Calculating the ending sector should be achieved by multiplying the CHS counts. However, the factor of these values from the previous example (254 x 63 x 1023 = 16370046 sectors) should mark the ending sector, noting the 63 sector offset. In this case, it does. The CHS addressing scheme would fall short approximately 33GB. To elaborate, remember that each sector has a value of 512 bytes, 16370046 x 512 bytes = 8381463552 bytes; divide by 1024 bytes/KB = 8185023KB / 1024KB/MB = 7993.18MB. A new method is required to address the growing capacity of today's drives: LBA.

As we have established, the CHS cannot mark the boundaries of the previous example. However, bytes 01CA01CD have the value "82 91 A8 04" and state the value of total sectors for the partition. LBA utilizes the total sector count to determine the end of one partition and the start of the next. Reversing the Endian order on bytes 01CA01CD, 4A89182(H) = 78156162 sectors. Applying 512 bytes per sector, we get 78156162 x 512 bytes = 40015954944, 40015954944 bytes / 1024 bytes/KB = 39078081KB / 1024KB/MB = 38162.188MB or a 38GB drive.

A key point about the LBA method is that partition locations are now relative rather than absolute. Another way to describe this behavior is that the end of a partition marks the beginning of the next.



Linux Troubleshooting for System Administrators and Power Users
Real World Mac Maintenance and Backups
ISBN: 131855158
EAN: 2147483647
Year: 2004
Pages: 129
Authors: Joe Kissell

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net