[fpc-pascal] Size of a partition

David W Noon david.w.noon at googlemail.com
Sat Dec 20 00:16:20 CET 2014

Hash: SHA1

On Sat, 20 Dec 2014 00:00:35 +0100, Rainer Stratmann
(rainerstratmann at t-online.de) wrote about "Re: [fpc-pascal] Size of a
partition" (in <201412200000.35347.rainerstratmann at t-online.de>):

> Hi Dave!
> that's exactly what I was searching for. Thanks a lot.

You're welcome.

> One question is left:
> Where can I read the blocksize. Normally it is 512 bytes. But there
> are (newer) devices where there is a different blocksize. Also a CD
> has a different blocksize as far I know.

There are 2 functions in the unit to do that:
get_physical_sector_size() and get_logical_sector_size().

If the disk's sector size is 512 bytes they will give the same answer.
 Likewise, for a CD or DVD they will give the same answer of 2048 bytes.

If a disk has a physical sector size of 4096 bytes, it is up to the
SATA/SAS driver to publish a logical sector size of either 4096 or
512.  I think this configuration is determined when you partition the
drive, where using GPT sets it to 4096 and using DOS-style partition
reverts it to 512 bytes, but this is just my guess -- I don't have a
large disk on which to test.
- -- 

Dave  [RLU #314465]
david.w.noon at googlemail.com (David W Noon)

Version: GnuPG v2


More information about the fpc-pascal mailing list