From: Al on
On Nov 20, 6:41 am, "Rod Speed" <rod.speed....(a)gmail.com> wrote:
> 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.

Your answer is so detailed I cant follow it.

>
> > What about offset?
>
> Nope.

Another great point of clarification.
From: Rod Speed on
Al wrote
> Rod Speed <rod.speed....(a)gmail.com> wrote
>> Al wrote
>>> 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.

> Your answer is so detailed I cant follow it.

Your problem. Fdisk uses CHS values, not LBA numbers.

>>> What about offset?

>> Nope.

> Another great point of clarification.

You're welcome.


From: Al on
Franc Zabkar <fzab...(a)iinternode.on.net> wrote:
>>LBA = (C x 255 x 63) + (H x 63) + (S - 1)

and test data:

Al <bigal.nz(a)gmail.com> wrote:
>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

thus start LBA:

LBA = (0 x 255 x 63) + (1 x 63) + (1 - 1)
= 0 + 63 + 0
= 63

and end LBA:

LBA = (121600 x 255 x 63) + (254 x 63) + (63 - 1)
= 1953504000 + 16002 + 62
= 1953520064

1) Are the units of LBA blocks? And if so, does (LBAe - LBAs) * 512 =
partition size?
2) Should the C and H values in the calculation be 64 and 121601
(because the numbering starts at 0?)

One of the commands I am dealing with is MOUNT and with the offset
switch.

Plenty of sites tell you to multiply the start (Cylinders) by 512 to
get the offset value. Therefore what unit is the offset value in?

Cheers

-Al



From: Al on


Al wrote:
> Franc Zabkar <fzab...(a)iinternode.on.net> wrote:
> >>LBA = (C x 255 x 63) + (H x 63) + (S - 1)
>
> and test data:
>
> Al <bigal.nz(a)gmail.com> wrote:
> >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
>
> thus start LBA:
>
> LBA = (0 x 255 x 63) + (1 x 63) + (1 - 1)
> = 0 + 63 + 0
> = 63
>
> and end LBA:
>
> LBA = (121600 x 255 x 63) + (254 x 63) + (63 - 1)
> = 1953504000 + 16002 + 62
> = 1953520064

I also noitce that LBAe-LBAs (1953520064-63) = 1953520001 which is one
number off the correct size in sectors for the partition. Why one
number wrong?

-Al
From: Rod Speed on
Al wrote:
> Al wrote:
>> Franc Zabkar <fzab...(a)iinternode.on.net> wrote:
>>>> LBA = (C x 255 x 63) + (H x 63) + (S - 1)
>>
>> and test data:
>>
>> Al <bigal.nz(a)gmail.com> wrote:
>>> 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
>>
>> thus start LBA:
>>
>> LBA = (0 x 255 x 63) + (1 x 63) + (1 - 1)
>> = 0 + 63 + 0
>> = 63
>>
>> and end LBA:
>>
>> LBA = (121600 x 255 x 63) + (254 x 63) + (63 - 1)
>> = 1953504000 + 16002 + 62
>> = 1953520064
>
> I also noitce that LBAe-LBAs (1953520064-63) = 1953520001 which is one
> number off the correct size in sectors for the partition. Why one number wrong?

Usual maths, its always end-start+1