In order to find a single sector we need to know the cylinder, the head the and the sector number for that track (eg.cyl 89 head 2 sector 72), this is called CHS (Cylinder – Head  – Sector) addressing. The operating systems normally use a Logical Block Addressing (LBA) able to skip and relocate the bad sectors; this is done assigning to the CHS positions an LBA value, each time a bad sector is found the chs value assigned to that single LBA is changed to the first spare sector available. The maps of these relocations are called P-list (permanent list) created during factory test and the G-list (growing list) updated each time a relocation takes place

Convertion From CHS to LBA

The equation to convert from CHS to LBA follows: LBA = ( ( CYL * HPC + HEAD ) * SPT ) + SECT – 1
LBA: linear base address of the block
CYL: value of the cylinder CHS coordinate
HPC: number of heads per cylinder for the disk
SPT: number of sectors per track for the disk
SECT: value of the sector CHS coordinate
TEMP: buffer to hold a temporary value
This equation is not used very often. Usually the software already has the LBA value and needs to calculate the CHS value for it.

Convertion From LBA to CHS

CYL = LBA / (HPC * SPT)
TEMP = LBA % (HPC * SPT)