Filesystem overhead
bscott at ntisys.com
bscott at ntisys.com
Mon Jul 28 20:14:37 EDT 2003
On Mon, 28 Jul 2003, at 7:50pm, ben at blackavar.com wrote:
> if I remember correctly, it's that du gets the size in K and then if you
> ask for bytes, converts the K to bytes... but it's been awhile.
What "du" actually does is use the "stat" family of system calls to find
information about the file's inode. The stat data includes a field that
includes the number of blocks used to store the inode's data. A "block", in
the context of "stat", is always 512 bytes in size. So the answer (from
"stat" or anything that uses it) will always be a multiple of 512. But I am
seeing differences in the hundreds of kilobytes, not just 512 or so bytes.
Another list reader suggested, off-list, that the numbers I am seeing
might include filesystem blocks used as "indirect blocks", which I had
forgotten all about. That explanation does seem possible, even likely, at
least for this particular example file (a very large, single file). I'm
going to have to do a little more exploring before I'm satisfied that is the
right answer "everywhere" ("everywhere" being defined as "on the systems it
has become a concern for me"). :-)
--
Ben Scott <bscott at ntisys.com>
| The opinions expressed in this message are those of the author and do |
| not represent the views or policy of any other person or organization. |
| All information is provided without warranty of any kind. |
More information about the gnhlug-discuss
mailing list