[mod.computers.vax] Computing Disk Usage

stansbury%mwvms@MITRE.ARPA (03/19/87)

--------
I need some information on computing the amount of disk space users are
using on our system.
     
Using several ways to compute disk usage, these are the figures I came up
with for a particular user (note: the files for this user are pretty
static - the user did not login while I was obtaining these figures):
     
    944 blocks from the DISKQUOTA utility
    860 blocks allocated - from DIRECTORY/SIZE=ALL/BY_OWNER=[?] disk:[000000...]
    579 blocks used - from DIRECTORY/SIZE=ALL/BY_OWNER=[?] disk:[000000...]
    668 blocks as reported by an accounting system we are testing
     
The documentation for the accounting system we are testing says it reads
the INDEXF.SYS file and gets the number of blocks for each file on that
disk owned by that user.
     
Questions:
     
1.  Why the difference between the DISKQUOTA utility and the number of
    blocks allocated (as shown by the DIRECTORY command)?
     
    I called the DEC 800 number in Colorado and asked them this question.
    They said the DISKQUOTA utility doesn't include lost files or the file
    header blocks for each file owned by that user. The DIRECTORY command
    includes the file header blocks, but not lost files. I did an ANAL/DISK
    on the disk, and it didn't show any lost files.
     
2.  Why would there be a difference in the information in the INDEXF.SYS file
    and what DISKQUOTA and DIRECTORY show?  (I am assuming the accounting
    system we are testing is correct - maybe a bad assumption though).
     
For those of you that charge users for using disk space on your machine, on
what figures do you base your disk space usage?  With the accounting system
we have been using for some time (not the one we are testing), we have been
using the figures from the DISKQUOTA utility.
     
Thanks,
Jack Stansbury
     
ARPA: jws@mitre

LEICHTER-JERRY@YALE.ARPA.UUCP (03/21/87)

(Hi, Jack!)

    ...
    Using several ways to compute disk usage, these are the figures I came up
    with for a particular user (note: the files for this user are pretty
    static - the user did not login while I was obtaining these figures):
         
        944 blocks from the DISKQUOTA utility
        860 blocks allocated - from DIRECTORY/SIZE=ALL/BY_OWNER=[?]
		disk:[000000...]
        579 blocks used - from DIRECTORY/SIZE=ALL/BY_OWNER=[?]
		disk:[000000...]
        668 blocks as reported by an accounting system we are testing
         
    The documentation for the accounting system we are testing says it reads
    the INDEXF.SYS file and gets the number of blocks for each file on that
    disk owned by that user.
         
    Questions:
         
    1.  Why the difference between the DISKQUOTA utility and the number of
        blocks allocated (as shown by the DIRECTORY command)?
         
        I called the DEC 800 number in Colorado and asked them this question.
        They said the DISKQUOTA utility doesn't include lost files or the file
        header blocks for each file owned by that user. The DIRECTORY command
        includes the file header blocks, but not lost files. I did an
        ANAL/DISK on the disk, and it didn't show any lost files.
         
Each file costs at least one header block, sometimes more (for large or very
fragmented files or files with large ACL's, for example).  The numbers you've
got - 944 blocks shown by DISKQUOTA, 860 by DIRECTORY - could be accounted for
by having 84 files with 1-block headers; this gives an average file size (used
blocks) of 6 blocks, which isn't unreasonable for some kinds of users.

    2.  Why would there be a difference in the information in the INDEXF.SYS
        file and what DISKQUOTA and DIRECTORY show?  (I am assuming the
        accounting system we are testing is correct - maybe a bad assumption
        though).

Disk quota entries have been known to be wrong.  Did you do a REBUILD?  After
a REBUILD, what DISKQUOTA shows should be exactly what's in the INDEXF file.
If they still disagree, I'd assume errors in your accounting system.  A likely
place to look:  There are oodles of caches for things, especially in a clus-
ter.  Just reading INDEXF.SYS may not give you up-to-date values.  (The caches
are organized to favor reliability over accuracy, so blocks may show up as
allocated in INDEXF.SYS when they really aren't; but the other way around is
unlikely.)
         
    For those of you that charge users for using disk space on your machine,
    on what figures do you base your disk space usage?  With the accounting
    system we have been using for some time (not the one we are testing), we
    have been using the figures from the DISKQUOTA utility.
         
We use the PACS software, which I believe uses DISKQUOTA's figures.

							-- Jerry
-------