MacOS size weirdness
Timothy A. Seufert
yellowdog-general@lists.terrasoftsolutions.com
Mon Jul 15 12:32:01 2002
At 1:33 PM +0100 7/15/02, Peter Bagnall wrote:
>So my disc checks out ok. BUT, comparing the files sizes in bytes with
>the number of blocks being used there's something odd going on. Every file
>seems to be using a blocks in multiples of 32. Now remember I said that
>unix has a tendency to lie about block sizes in the tool I'm using, what
>that really suggests is that the block size is 32 times bigger than it's
>quoting. That would be a block size of a huge 16kB. On a 1 GB disc. There
>is another possibility, that HFS standard allocated blocks in 16kB groups,
>but that would be rather strange, that is it allocates 32 blocks at a time
>to a file. This tallies with what get info says though. It reports 16kB
>used for a 600 or so byte file. That really does suggest a 16kB block
>size, which is frankly much bigger than I would expect.
HFS uses 16-bit block numbers, so there can be at most 2^16 or 65536
blocks in a HFS volume. 1 GB = 2^30 bytes. Divide that by the
number of blocks and we get 2^14 bytes per block, which is 16kB.
At 5GB, it works out to 80kB blocks.
HFS+ uses 32-bit block numbers, which will be sufficient to keep
block size at 4kB until we get >16TB disks.
--
Tim Seufert