# LBA number

#### Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

•  Subject
• Author
• Posted on
Is there a standard way you can calculate the LBA number from
Cylinders, Sectors, and Heads of a disk?

For instance, how could you do it for this disk:

Number of Disks - 2.
Cylinders - 16,383.
User Sectors/Track at zone 0 - 63.
Logical Blocks (LBA) - 195,371,568.

Thank you.

## Re: LBA number

mike7411@gmail.com wrote:

Number of Disks - 2.
*Cylinders - 16,383.
*User Sectors/Track at zone 0 - 63.
Logical Blocks (LBA) - 195,371,568.

You cannot calculate an LBA number from above figures.
Those CHS figures (marked *) are read from the disk (by an IDENTIFY
DEVICE command) to calculate a default capacity (below 8GB) while
starting from the disk and have nothing to do with LBA.

16heads * 16383cylinders * 64sectors = 16776192sectors
There 2 sectors in each KB, 1024 KB's in each MB
16776192sectors/2*1024 --> 8192.5MB

You can't calculate the LBA number easily, even if you have more info,
cylinders may have a different number of sectors on them.

## Re: LBA number

"Eric P." wrote:

... snip ...

Because there is no such thing these days as a count of sectors per
cylinder, or anything else.  All that is required is that the LBA
number uniquely identify a sector.  That sector may be widely
separated from the adjacent numbered sector, because of such things
as bad sector replacement.  Modern disks tend to have more sectors
on the outer edges than on the inner, thus maintaining constant
data density.

--
Chuck F (cbfalconer@yahoo.com) (cbfalconer@maineline.net)
Available for consulting/temporary embedded and systems.

## Re: LBA number

Eric P. wrote:

One of the ways to tell that a drive uses LBA is it always has the
magic number 16,383 as cylinders.  If it's not that number, you can get
close to the actual size of the drive in megabytes in 98% of the cases
by dividing the number of cylinders by 2.

Most drives above 8GB use LBA instead of CHS.

You can also rougly calculate Gigabytes by dividing the Max LBA by 2
million.

Your drive is near 100GB. It might even say 100GB on it. It's actually
93GB.

## Re: LBA number

Do you calculate the number of bytes on the drive by multiplying the
LBA by 512?

Are all drives standardized to 512 bytes per LBA?

Thank you.

paulmd@efn.org wrote:

## Re: LBA number

mike7411@gmail.com wrote

Yes.

Not quite all, some scsi drives can be
formatted with different sized sectors.

## Re: LBA number

mike7411@gmail.com wrote:

Nope, because the Cylinders, Sectors, and Heads
arent real numbers, they are faked up. With all
modern drives the number of sectors per track
varys in bands of cylinders across the platter surface.

Those two are real numbers.

That one isnt, which is why the word logical is used.

That is saying that the sectors per track varys
in bands/zones across the platter surface.

That number is real, but doesnt help with the CHS value each corresponds to.