[Summary] : Disk space management

From: Lovekesh Uppal (luppal@BayNetworks.COM)
Date: Wed May 12 1999 - 23:25:29 CDT


Original Problem:

Hi all
 Can anybody Pls advice me how to start disk quotas for users?
 also , is there a way that one of the filesystems be shared by several
users
 ( basically a group )but with some common quota that applies on to that...I
 mean that say the max usage that this group can have on this filesystem is
 say 20%.....
 Hope I m clear........
 Thanx in advance....
 Lovekesh Uppal
 E-mail id:
 luppal@baynetworks.com

Solution:

( I got no solution or hint for maintaining quotas for groups......)

You will need to be root (super user) for all of these procedures. This
example shows how to set up quotas for users whose $HOME
directory is in /export/home.
This method will work for any discreet file system. If
you wish to do this for another filesystem, just substitute your
filesystem path for /export/home and follow these steps:
1. You must have a file called quotas located in /export/home.
      touch /export/home/quotas
2. Enable quota checking for the file system by editting
/etc/vfstab.
Here is an example of how it can look:
#device device mount
FS fsck mount mount
#to mount to fsck point
type pass at boot options
/dev/dsk/c0t1d0s4 /dev/rdsk/c0t1d0s4 /opt2 ufs
2 yes quota

Normally, "mount options" is a '-', but here you would enter "quota".
3. Edit a user for quota (use a real user login on your system)
                   cd /export/home
                   edquota user1

This will bring up the VI editor so edit the value of hard=0 to
hard=10240
Write and quit vi. Each block equals 1K so 10240
blocks=10 megabytes for file space.
4. To add more users that should have the same amount of restricted space,
     use the -p (proto-type option). Where user1 is already a quota user
     and user2 is the new quota user to be added.
         edquota -p user1 user2

   This will add user2 to the quota file with the same
   restrictions the quota limited user user1.
5. Quota will only start counting the new files that the
    user creates at the point of being added. It does not add files the
    user already owns. If you want quota to calculate the already
    owned space of all the quota users in /export/home,
           quotacheck /export/home

     This will look for all the files owned in this file system for users
     with quotas and adjust the values for what the user already owns.

6. If a user has exceeded the amount allowed he will receive a message at
     login
          Block limit reached on /export/home
   The user will have to delete some files before he can copy or create
   any new files in the /export/home file system. (Nice feature for already
hoggy users).
  If the user tries copy or create a file beyond the amount of space
allowed,
  they will receive and error message that this can not be done due to over
hard disk limit.
7. To view the statistics of a quota user,
                      cd /export/home
                      quota -v user1
                      quota -v user2
8. To increase or decrease the limit of a quota user:

                      cd /export/home
                      edquota user1

     That user statistic will open in the VI editor.
     Adjust the hard value. Write and quit the VI editor. View your
     changes with:
                      quota -v roy

9. To generate a report on quota usage, use the repquota
command: This will generate a report for all mount systems with
the "rq" option in their mount options:

                      repquota -a

The /etc/vfstab should look like this is you want to use the "-a" option:

#device device mount FS
fsck mount mount
#to mount to fsck point type pass
at boot options
/dev/dsk/c0t1d0s4 /dev/rdsk/c0t1d0s4 /opt2 ufs 2 yes
quota,rq

To generate a report for all users, use the "-v" option:

                      repquota -v



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:13:19 CDT