[fpc-pascal] Size of a partition

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


-----BEGIN PGP SIGNED MESSAGE-----
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.
- -- 
Regards,

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iEYEARECAAYFAlSUscQACgkQogYgcI4W/5To2wCfeUNNrWY1Gl7KK/HRvLdzUfWs
aZ8An2jp7kBJcJkGkdSmLP/C4DxZ35SU
=zCW3
-----END PGP SIGNATURE-----



More information about the fpc-pascal mailing list