From: Arno on
Al <bigal.nz(a)gmail.com> wrote:
> On Nov 19, 9:29?am, Grant <g_r_a_n...(a)bugsplatter.id.au> wrote:
>> Forget CHS -- the important number for large disks is the 8225280
>> bytes per cylinder.

> Can you use the 8225280 bytes per cylinder with total number of
> cylinders to calculate disk size?

>>
>> Look at fdisk's 'x' mode display? ?It shows the uninterpreted sizes:
>>
>> Command (m for help): p
>>
>> Disk /dev/sda: 80.0 GB, 80025280000 bytes
>> 255 heads, 63 sectors/track, 9729 cylinders
>> Units = cylinders of 16065 * 512 = 8225280 bytes
>> Disk identifier: 0x45e0afb2

> ie: Why does the 8225280 * 9729 <not equal> 8002528000 bytes???

> After all its the cylinder size * number of cylinders???

Only for the virtual C/H/S geometry. The there is some redidual space
at the end that can be accessed using LBA (as Linux does).

Arno
--
Arno Wagner, Dr. sc. techn., Dipl. Inform., CISSP -- Email: arno(a)wagner.name
GnuPG: ID: 1E25338F FP: 0C30 5782 9D93 F785 E79C 0296 797F 6B50 1E25 338F
----
Cuddly UI's are the manifestation of wishful thinking. -- Dylan Evans
From: Arno on
Al <bigal.nz(a)gmail.com> wrote:
>> >a sector? ie 4 blocks = 1 sector or whatever?
>>
>> There's different block sizes, depending on usage. ?Filesystem may
>> allocate space in 1k or 4k (or larger?) blocks depending on partition
>> size.
>>

> So are you saying block size is a function of File System?

Not really. "block" has no fixed meaning. A "filesystem block",
also called "cluster" siometimes is is indeed a unit depending
on the filesystem parameters. See the -b option to mke2fs, e.g..

Unfortunalely the term "block" is in widespread use, but it only
gets meaning when you know the context.

Arno

--
Arno Wagner, Dr. sc. techn., Dipl. Inform., CISSP -- Email: arno(a)wagner.name
GnuPG: ID: 1E25338F FP: 0C30 5782 9D93 F785 E79C 0296 797F 6B50 1E25 338F
----
Cuddly UI's are the manifestation of wishful thinking. -- Dylan Evans
From: Al on
On Nov 19, 9:33 pm, Arno <m...(a)privacy.net> wrote:
> Al <bigal...(a)gmail.com> wrote:
> >> >a sector? ie 4 blocks = 1 sector or whatever?
>
> >> There's different block sizes, depending on usage. ?Filesystem may
> >> allocate space in 1k or 4k (or larger?) blocks depending on partition
> >> size.
>
> > So are you saying block size is a function of File System?
>
> Not really. "block" has no fixed meaning. A "filesystem block",
> also called "cluster" siometimes is is indeed a unit depending
> on the filesystem parameters. See the -b option to mke2fs, e.g..
>
> Unfortunalely the term "block" is in widespread use, but it only
> gets meaning when you know the context.
>
> Arno
>
> --
> Arno Wagner, Dr. sc. techn., Dipl. Inform., CISSP -- Email: a...(a)wagner.name
> GnuPG:  ID: 1E25338F  FP: 0C30 5782 9D93 F785 E79C  0296 797F 6B50 1E25 338F
> ----
> Cuddly UI's are the manifestation of wishful thinking. -- Dylan Evans

Thanks for the detailed reply, and I will read in depth tomorrow.

Testdisk reports a size in sectors.
Fdisk reports a size in blocks
Mounting partitions with offset wants a offset in??? (blocks/sectors?)
And then there is LBA

Is there a way to convert any of this to say bytes?

All bloody confusing to be honest. Is the LBA addressing people refer
to the same addressing system used by Fdisk? What about offset?

Cheers

-Al

From: Rod Speed on
Al wrote:
> On Nov 19, 9:33 pm, Arno <m...(a)privacy.net> wrote:
>> Al <bigal...(a)gmail.com> wrote:
>>>>> a sector? ie 4 blocks = 1 sector or whatever?
>>
>>>> There's different block sizes, depending on usage. ?Filesystem may
>>>> allocate space in 1k or 4k (or larger?) blocks depending on
>>>> partition size.
>>
>>> So are you saying block size is a function of File System?
>>
>> Not really. "block" has no fixed meaning. A "filesystem block",
>> also called "cluster" siometimes is is indeed a unit depending
>> on the filesystem parameters. See the -b option to mke2fs, e.g..
>>
>> Unfortunalely the term "block" is in widespread use, but it only
>> gets meaning when you know the context.

> Thanks for the detailed reply, and I will read in depth tomorrow.
>
> Testdisk reports a size in sectors.
> Fdisk reports a size in blocks
> Mounting partitions with offset wants a offset in??? (blocks/sectors?)
> And then there is LBA

> Is there a way to convert any of this to say bytes?

Yes, but there is no point in doing that.

> All bloody confusing to be honest. Is the LBA addressing
> people refer to the same addressing system used by Fdisk?

Nope.

> What about offset?

Nope.


From: Al on
On Nov 19, 5:38 pm, Franc Zabkar <fzab...(a)iinternode.on.net> wrote:
> Partition size (in sectors) = End LBA - Start LBA + 1
>
>  = (Ce - Cs) x 255 x 63 + (He - Hs) x 63 + (Se - Ss) + 1

TestDisk 6.10, Data Recovery Utility, July 2008
Christophe GRENIER <gren...(a)cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/sda - 1000 GB / 931 GiB - CHS 121601 255 63
Current partition structure:
Partition Start End Size in sectors

1 * Linux 0 1 1 121600 254 63 1953520002

= (121600 - 0) x 255 x 63 + (254 - 1) x 63 + (63 - 1) + 1
= (121600) x 255 x 63 + (253) x 63 + (62) + 1
= 1953504000 + 15939 + 63
= 1953520002

Brilliant.