Quota Commands Summary

by Mike on October 6, 2009 · 2 comments

in Server Management

There are a number of excellent quota commands that will help you get the job done quickly.  You will want to practice these commands so that you can use them quickly when you need to as users will probably see it a crisis situation when they cannot save when they go over the quotas you set.

Lesson 2 | Lesson 4

-u       check quotas for a user
-g       check quotas for a group
-q       show file systems where the user is over the limit

quota -u tom

This command creates a summary of quotas on a file system.
-u report on quotas for a user
-a report on quotas for entire file system
-v report all quotas even if no usage
-g report quotas for groups

repquota /home

This provides a way to edit quotas for users.
-u edit user
-g edit group
-t edit soft limit time
-p setup a policy for another user

In this example the already established policy for fred is given to mary.  This is a way to create a standard policy.

edquota -p fred mary

Another way of setting quotas is with the setquota command.
-u    user
-g    group
-t    set grace period

setquota -u joe 2000 6000 0 0 /home


The following options can be employed with the command quotacheck to gain information for managing the server, run only when the file system is unmounted in most cases. The file system is not ready to run quotas until the quotacheck command is run to see what disk space is already used.
Commands           Descriptions
-a                 scan for quotas by checking the /etc/mtab file
-v                verbose scan
-u                 scan for user quotas
-g                 scan for group quotas
-m                 remounts a scanned filesystem

If you run a command like this (only run it on an umounted system), it will check all the above:
quotacheck -avugm /home

This command will check the /etc/mtab.
If the quotas were setup correctly there should be a aquota file in the directory that the quotas were setup on. Try this command for quotas on the /home directory, assuming /home is on a separate partition.

ls -la /home/aquota.*
You should see the output that the file exists, either called aquota.user (for user quotas) or aquota.group (for group quotas).  These are binary files that store disk usage in the top level of the partitions.

Previous post:

Next post: