[HPADM] [SUMMARY Addition] User Disk Quota

From: Ben Le (ble@pcc.edu)
Date: Mon Apr 25 2005 - 12:23:17 EDT


Hi List,

I have been discussed this issue with Bill Hassell and got very good info
from Bill that I thought I would share with all of you.

 From Bill:

In Unix, a block has been a classic unit of measure, 512 bytes or
1/2 Kbytes. So 10,000 blocks is 5,000K or 5 megs. The du command
also measures disk space in 1/2K blocks.
            block value * 0.5 / 1,000 = Size in mg
            example: 10,000 * .05 /1,000 = 5mg
If you want to set 50mg disk quota for user, you need to set the value of
'hard block' to 100,000.
Use this to test if quotas work, as in:
             prealloc testfile 50000000
to create a 50 meg file.

I also sent this question to Bill:
A little odd with disk space reporting. I created a test account for disk
quota setup. Set disk quota block to 100,000. Create a 'testfile' for 50mg
as you suggested. After 50mg file created, disk quota reports only usage of
48,835 block size. Should it reported 100,000 block size, any idea?

 From Bill:
Welcome to the world of Unix sparse files. The Unix filesystem can be told
to create a file with exactly 2 records, one at location 1 and the other at
address 1,000,000. Users can read the file serially and technically, the
undefined records do not exist but Unix will supply a series of nulls for
the missing records. The occupied space is just 2 records but if you
copy the file, the copy will be 1 million records in size. So there is
a directory size and an occupied size. If you run these commands:

    du file_name
     ll file_name

You'll see a big difference.

Prealloc creates a sparse file. Just cp the file to another file and
you'll get a 50meg result.

__________________________________________
Benjamin Le
Sr. Systems Administrator
Information Technology Services
Portland Community College
Voice:(503)-977-4736 Fax:(503)-977-8124
Mailto:ble@pcc.edu http://www.pcc.edu

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:47 EDT