Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
17.  Managing Quotas (Tasks) Checking Quotas  Previous   Contents   Next 
   
 

How to Check for Exceeded Quotas

You can display the quotas and disk use for individual users on file systems on which quotas have been activated by using the quota command.

  1. Become superuser.

  2. Display user quotas for mounted file systems where quotas are enabled.

    # quota [-v] username

    -v

    Displays one or more users' quotas on all mounted file systems that have quotas.

    username

    Is the login name or UID of a user's account.

Example--Checking for Exceeded Quotas

The following example shows that the user account identified by UID 301 has one 1-Kbyte quota but has not used any disk space.

# quota -v 301
Disk quotas for bob (uid 301):
Filesystem  usage  quota limit timeleft files quota  limit timeleft
/export/home   0      1     2             0      2      3

Filesystem

Is the mount point for the file system.

usage

Is the current block usage.

quota

Is the soft block limit.

limit

Is the hard block limit.

timeleft

Is the amount of time (in days) left on the quota timer.

files

Is the current inode usage.

quota

Is the soft inode limit.

limit

Is the hard inode limit.

timeleft

Is the amount of time (in days) left on the quota timer.

How to Check Quotas on a File System

Display the quotas and disk use for all users on one or more file systems by using the repquota command.

  1. Become superuser.

  2. Display all quotas for one or more file systems, even if there is no usage.

    # repquota [-v]  -a filesystem

    -v

    Reports on quotas for all users, even those users who do not consume resources.

    -a

    Reports on all file systems.

    filesystem

    Reports on the specified file system.

Example--Checking Quotas on a File System

The following example shows output from the repquota command on a system that has quotas enabled on only one file system (/export/home).

# repquota -va
/dev/dsk/c0t3d0s7 (/export/home):
                  Block limits              File limits
User      used   soft   hard  timeleft  used  soft   hard  timeleft
#301  --            0      1   2.0 days         0      2      3  
#341  --    57     50     60   7.0 days  2      90    100  

Block limits

 

used

Is the current block usage.

soft

Is the soft block limit.

hard

Is the hard block limit.

timeleft

Is the amount of time (in days) left on the quota timer.

File limits

 

used

Is the current inode usage.

soft

Is the soft inode limit.

hard

Is the hard inode limit.

timeleft

Is the amount of time (in days) left on the quota timer.

Changing and Removing Quotas

You can change quotas to adjust the amount of disk space or the number of inodes users can consume. You can also remove quotas, for individual users or from entire file systems, as needed.

The following table describes the commands you use to change quotas or remove quotas.

Table 17-3 Commands for Changing Quotas and Removing Quotas

Command

Man Page

Description

edquota

edquota

Changes the hard limits and soft limits on the number of inodes or amount of disk space for each user. Also, changes the soft quota time limit for each file system with a quota.

quotaoff

quotaoff(1M)

Turns off quotas for specified file systems.

How to Change the Soft Time Limit Default

By default, users can exceed the soft time limits for their quotas for one week. So, after a week of repeated violations of the soft time limits of either disk space quotas or inode quotas, the system prevents users from using any more inodes or disk blocks.

You can change the length of time that users may exceed their disk space quotas or inode quotas by using the edquota command.

  1. Become superuser.

  2. Use the quota editor to create a temporary file that contains soft time limits.

    # edquota -t

    Where the -toption specifies the editing of the soft time limits for each file system.

  3. Change the time limits from 0 (the default) to the time limits you specify by numbers and the keywords month, week, day, hour, min, or sec.


    Note - This procedure does not affect current quota violators.


Examples--Changing the Soft Time Limit Default

The following example shows the contents of the temporary file opened by the edquota command on a system where /export/home is the only mounted file system with quotas. The 0 (default) value means that the default time limit of one week is used.

fs /export/home blocks time limit = 0 (default), files time limit = 0 (default)

The following example shows the same temporary file after the time limit for exceeding the blocks quota has been changed to two weeks, and the time limit for exceeding the number of files has been changed to 16 days.

fs /export/home blocks time limit = 2 weeks, files time limit = 16 days

How to Change Quotas for a User

  1. Become superuser.

  2. Use the quota editor to open a temporary file containing one line for each mounted file system that has a quotas file in the file system's root directory.

    # edquota username

    Where username specifies the user name whose quota you want to change.


    Caution - Although you can specify multiple users as arguments to the edquota command, the information displayed does not show which user this information belongs to, which could create some confusion.


  3. Enter the number of 1-Kbyte disk blocks, both soft and hard, and the number of inodes, both soft and hard.

  4. Verify that a user's quota has been correctly changed.

    # quota -v username

    -v

    Displays user quota information on all mounted file systems with quotas enabled.

    username

    Specifies the user name whose quota you want to check.

Examples--Changing Quotas for a User

The following example shows the contents of the temporary file opened by the edquota command on a system where /files is the only mounted file system containing a quotas file in the file system's root directory.

fs /files blocks (soft = 0, hard = 0) inodes (soft = 0, hard = 0)

The following example shows the same temporary file after quotas have been changed.

fs /files blocks (soft = 0, hard = 500) inodes (soft = 0, hard = 100)

The following example shows how to verify that the hard quotas for user smith have been changed to 500 1-Kbyte blocks, and 100 inodes.

# quota -v smith
Disk quotas for smith (uid 12):
Filesystem  usage  quota  limit  timeleft  files  quota  limit  timeleft
 
  /files     1       0     500              1       0     100
 
 
 
  Previous   Contents   Next