HMC Homepage      CS Home

Disk Quotas

Contents

Introduction

In order to keep disk usage on our systems under control, the user home directories are kept under quota control (See the quota section of the policy qref). The quota system prevents you from writing any files once you have maxed out your allotted disk space, usually 60 megabytes. The quota system also regulates the number of files you can have, but you are unlikely to reach your file limit before your space limit unless you are creating a very large number of very small files.

The home directories now reside on Thumper, one of the CS department's file servers. Unfortunately, Thumper does not support the "soft quota" system which was present up until the summer of 2000. Your quota now consists of a single size limit. You can write files to disk until you reach that limit, and once you reach it, you will stop being able to write files to disk until you reduce your disk usage.

We have several utilities in place to make your quota easier to manage. Most of these were created specifically for Mudd, so do not expect to find them on other Unix systems you may encounter.

Checking your disk quota

checkQuota

The easiest way to check your quota is the checkQuota utility. To run it, simply type checkQuota. You will recieve a report of your disk and file quotas, similar to the following:


Space quota (KB):           61440
Current space usage (KB):   21616 (35.2%)
File quota (files):         30720
Current file usage (files): 1034 (3.4%)

If you are close to your quota, you will also see a warning message. checkQuota -s surpresses normal output, and gives you only the warning, or else no output at all. This version of checkQuota is useful for personal scripts, and indeed is a default part of your login script. See below for more information on what happens as you approach your quota.

quota

In order to make our system as standardized as possible, the original quota utility has been modified to produce the same sort of output as checkQuota. The original utility is sunquota, but it is likely you will never need to use it. quota defaults to the same behavior as checkQuota -s. That is, typing quota will only give you a warning if you are above 90% of your quota, and otherwise will not produce any output.

To see detailed (verbose) output equivalent to the output shown above, type quota -v. It will display the same output as checkQuota. The reason for this is that most UNIX systems come with a quota utility called quota which only displays detailed output if it is run with the -v argument. checkQuota was written specifically for this system.

sunquota

The standard utility that is built into the system, now called sunquota to avoid conflict with the new quota, had some problems that the new versions fix. However, the new versions are not full replacements for sunquota. If you are a normal user and you only work in your home directory, or in unquota'd areas such as /proj/, checkQuota or quota -v should be sufficient for your needs. If, however, you have active quotas in more than one location, you may need to use sunquota. The following is an explanation of its rather confusing output.

The problem with sunquota is that it is confused by the automounter. Each home directory is individually mounted on demand by the automounter. However, quotas are applied not to individual home directories but to the entire filesystem of which they are a part (staffhome/, fachome/, or userhome/ on Thumper). When quota is scanning to determine your quota on each filesystem, it does so by checking your quota on every mount point in the file tree that it can find. Since each home directory is a mount point, it will check your quota in each home directory. Since each home directory is in fact part of the same partition on Thumper, it will report the same quota status for each home directory. Here is an example of output from the normal sunquota -v command (quota is normally invoked with the -v flag):

Disk quotas for gromer (uid 20667):
Filesystem     usage  quota  limit    timeleft  files  quota  limit    timeleft
/home/tim         12 317440 317440                  2 163840 163840            
/home/nate        12 317440 317440                  2 163840 163840            
/home/enorton
               21416  61440  61440               1032  30720  30720            
/home/kevin       12 317440 317440                  2 163840 163840            
/home/charlie
                  12 317440 317440                  2 163840 163840            
/home/erik        12 317440 317440                  2 163840 163840            
/home/mschubme
               21416  61440  61440               1032  30720  30720            
/home/pablo    21416  61440  61440               1032  30720  30720            
/home/cbw      21416  61440  61440               1032  30720  30720            
/home/chummels
               21416  61440  61440               1032  30720  30720            
/home/quay        12 317440 317440                  2 163840 163840            
/home/plb      21416  61440  61440               1032  30720  30720            
/home/greg        12 317440 317440                  2 163840 163840            
/home/roy         12 317440 317440                  2 163840 163840            
/home/grae     21416  61440  61440               1032  30720  30720            
/home/sboone   21416  61440  61440               1032  30720  30720            
/home/pnguyen
               21416  61440  61440               1032  30720  30720            
/home/gromer   21416  61440  61440               1032  30720  30720            
/home/bpellett
               21416  61440  61440               1032  30720  30720            
/home/tkelly   21416  61440  61440               1032  30720  30720            
/home/titus       12 317440 317440                  2 163840 163840            
/home/aclark   21416  61440  61440               1032  30720  30720            
/home/is          12 317440 317440                  2 163840 163840            
/home/stephen
                  12 317440 317440                  2 163840 163840            
/home/colin       12 317440 317440                  2 163840 163840            
/home/cds      21416  61440  61440               1032  30720  30720            
/home/dave        12 317440 317440                  2 163840 163840            
/home/djm      21416  61440  61440               1032  30720  30720            
/home/question
                  12 317440 317440                  2 163840 163840            
Try running checkQuota for simpler output
You will see a different listing, possibly a longer one, depending on which home directories are mounted at the time. Note that I am getting essentially the same quota reports over and over again. These represent my quotas on the staff and user partitons on thumper, depending on where the home directory listed is mounted from. Note that these are actually my quotas, not those of the users whose home directories are listed. The quota status of other users is confidential information and is acessible only by them and the superuser. Note: checkQuota and the new quota also support this feature for the superuser.

If you must use sunquota, you will have to scan this output visually for the information you need. The quota reports on other home directories can safely be ignored. An additional note: sunquota with no arguments actually invokes checkQuota -s, which has nearly the same behavior as sunquota with no arguments, but has a more useful warning message.

xdiskusage

xdiskusage is a handy tool that visually maps blocks of used space. When you open it, a window pops up prompting for a directory name. Type in /home/yourusername, and it will plot a visual map of the file distribution. The total space used is on the far left block, with the divisions lined up to the right, grouped by subdirectory. If you choose the "measure directories only" button, only the directories taking up space will be named, while the "measure directories and files" will include the names of large files. You can also type xdiskusage ~ to map your home directory without the dialog box.

Approaching your quota

As noted above, there is currently no soft quota system in place to warn you when you are approaching your quota. We do, however, have a couple of systems which should help keep you aware of an imminent quota problem.

E-mail notification

You should recieve a automated warning within 30 minutes of getting too close to your quota. You are considered "too close" if you have filled over 90% of your quota. This e-mail will be your only notification- it will not repeat. Once you have cleared up enough space, it will notify you if you get too close again. The purpose here is to notify you before serious quota problems arise (see below), without constantly harrassing you about your space usage.

checkQuota and quota output

If you are too close to your quota (where "too close" is defined as above), the output of checkQuota or quota will include a warning to that effect. As noted above, quota with no arguments, which is run when you log in, is equivalent to checkQuota -s, providing only the warning message.

Hitting your quota

Hitting your quota is a problem. As soon as you have reached your quota, you lose your ability to create or write files in your home directory. Even if you don't want to write any files (unlikely), it is important that you be at least a few kilobytes from your quota. Some system processes, such as the mail delivery system, will try to write files in your name, and all kinds of problems can start happening if they are unable to. Many user-level applications will also try to write temporary files or logs, and if they are prevented, their behavior in that case is unpredictable. In short, do not let yourself stay maxed-out for any length of time.

If you need help lowering your disk use, see the Clearing Space qref, or talk to a consultant.


Copyright (c) HMC Computer Science Department. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License.''

HMC Computer Science Department
Contact Information
Last Modified Monday, 25-Mar-2002 09:33:12 PST