On Wed, 3 Nov 1999 tkaczma@gryf.net wrote:
On Wed, 3 Nov 1999, John K. Edwards wrote:
I don't have a handy pointer, and it's too early for me to think clearly enough to find one. Did they go from 2KB to 4KB?
That was my initial guess, but:
a) It would have been true with respect to all the files, not just directories, and the size of the file is as reported by "ls" is unrelated to the actual size of the file, i.e. sparse files will show much larger than they are in reality.
b) The size of the directory would be rounded up to 4k and not double. Besides ls does not round up to block boundaries, i.e. if you have a 3 byte file it will report 3 bytes.
This is what I am seeing:
Auspex:
dr-xr-xr-x 2 user group 59392 Oct 29 07:01 dir1
NetApp:
dr-xr-xr-x 2 user group 118784 Oct 29 09:49 dir1
How much space do directories actually occupy? How do I find that out? (Please do not suggest "du" unless you thought it through.)
Why do I see the apparent doubling in size?
Does the difference in apparent size affect the quota? (With sparse files the "ls size" doesn't matter.)
Tom
Many people have mostly small directories, so the one block explanation was my first attempt. Since that didn't work. I'll refer to Dave's initial comment that our particular directory entry and directory block formats are different. For directories, the size reported by ls is typically the exact size of the directory. This is certainly true on filers. If you add an entry to a directory, the directory will either remain the same size or increase by one block (4096 bytes on a filer). The directory is like a little simple database that grows one full block at a time. If you want to know how much space is used by a directory on a filer do "ls -l" from a NFS client or the moral equivalent from a CIFS client.
Directories are not included in quotas on filers. Occasionally the argument breaks out as to whether this is a feature or a bug. I'd have to appeal to the ancients or dig through ancient documents for the precise motivation for this design decision, but I suspect the fact that the filer decides the format of the metadata in the directory would figure highly in an explanation.
John