On 2000 February 27, disk quotas were (re)introduced for home directories on Sun systems. And on 2001 December 13, disk quotas were introduced for /d/coma/1. More recently, quotas had to be introduced for the anonymous FTP areas.

Here is a detailed ``user's guide'' in Q&A format. (Feel free to submit additional questions.)

  • What are quotas?
  • Why are there quotas?
  • How can I find out what my quota is?
  • What should I do when I exceed my quota?
  • How can I have my quota increased?

  • What are quotas?

    Disk quotas are limits on the amount of space you are allowed to use on a given disk. File quotas are the equivalent for the number of files you can create. Since we do not set file quotas, ``quotas'' is used in the disk sense in this document.

    A quota is actually a set of two numbers: the soft and hard limits. The system administrator sets the value(s) of your quota. Once set, every time you try to create/modify a file, the operating system checks how much space you are using and how much more the new/modified file would take.

    If you are about to exceed your soft limit, the operating system warns you and gives you some grace period to get rid of excess files and get back under the soft limit. After that period, or if you were going to exceed the hard limit, it prevents you from creating/modifying any file.

  • Why are there quotas?

    Without quotas there is a natural tendency for disks to fill up... In most cases this is not a problem. However, it is for home directories because a minimum of free space is needed there for each user to carry out some basic tasks such as editing, compiling, etc... So if we let any user fill up the disk where everybody's home directory is located, no one would be able to work. Also, experience shows that a handful of users would hog most of the space, while the majority of users would have to make do with a tiny fraction. Having quotas gives each user an idea of how much space it is reasonable to use.

    Since disk space is limited, each user has to restrict himself/herself to using a fair share of the ``home'' disk. Besides, not all your files have to be in your home directory. If you have lots of data, you should put them on a data disk; if you download papers from the net or files from a tape, they should go on a scratch disk. Through the use of links (man ln) you can even ``pretend'' that all your files are in your home directory (and therefore use a path starting with ~/), even though they are physically stored on a different disk.

  • How can I find out what my quota is?

    Use the command quota -v , which will display your quota on all mounted disks on which quotas are in effect. The first column (``filesystem'') is the name of the disk; the second (``usage'') the amount of space you are currently using on that disk; the third (``quota'') is your soft limit; and the fourth (``limit'') is your hard limit. If there is a value in the fifth column (``timeleft''), it tells you how much longer you can stay above your soft limit before being unable to create new files. (All remaining fields are for file quotas and can be ignored.) A value of 0 (or an empty field) means no restriction.

    When you login, the quota command is run (which is why it sometimes takes so long to get a prompt) to give you a warning if you are over the limit. If you interrupt this command (to get a prompt faster), you run the risk of not being alerted about being over your quota... You should check your quota periodically (e.g. daily) if you want to reduce your chances of going over. However, the buffer between soft and hard limits is sufficiently large (50 MB in most cases) that it is unlikely you will go from under soft to above hard within the time limit.

  • What should I do when I exceed my quota?

    If you are reaching your hard limit, the only thing you can do is (re)move files (from your home directory) immediately, or you may be unable to do anything else (possibly including logging in again).

    If you are above your soft limit (but under your hard limit), you have two weeks (from the time you first went above) to get back under it, after which you get the same effect as if you had reached your hard limit.

    There are two simple things you could do to reduce your disk usage and hopefully go back under your quota:

  • reduce the cache size for Netscape: It is really not necessary to save a lot of documents in your cache (10 MB is a reasonable limit). Go to the Edit menu and select Preferences...; pull down the Advanced submenu and click on Cache; there, edit the disk cache size, then click on clear disk cache and then on the OK button. In addition, type the following on the command line after quitting Netscape:
    nice rm -fr ~/.netscape/cache/*
    (Alternatively, you can keep a large cache size, but move the directory ~/.netscape/cache to a scratch disk since it does not contain any critical files; see below for detailed instructions on moving directories across disks.)

  • compress PostScript files: This will typically save 95% of the space they take (which is currently about 3.0 GB!! on the disk where all home directories are--or 15% of the total space in use). To do that, type:
    nice find ~/. -mount -name "*.ps" -exec nice gzip {} \;
    Of course, you probably do not want to compress the PS files that you are using frequently; e.g. figures being included in a paper you are writing, or those in your ~/public_html web pages directory (unless you modify the links in your web pages accordingly). To uncompress a single PS FILE, type:
    nice gunzip FILE.ps.gz
    To uncompress all PS files in a SUBDIRECTORY, type:
    nice find ~/SUBDIRECTORY -mount -name "*.ps.gz" -exec nice gunzip {} \;

  • remove core files: Those files are created when a program that you run crashes and they can get very large. To locate them, type:
    nice find ~/. -mount -name core -type f -exec nice ls -ls {} \;
    You can then inspect them (file ./core run in the directories where each of those files are will tell you whether they are core files or files to which you intentionally gave the name core) and remove them if you do not need to keep them.
  • If that is not enough, you will have to move some files to another disk (most likely a data disk). If your home directory is reasonably well organized, it is easier to just move entire subdirectories. To find out how much space each of your subdirectories takes, type:

    nice du -ks ~/* ~/.??* | sort -n
    (which will give you a listing ordered by increasing size).

    Suppose you want to move ~/SUBDIRECTORY to /ANOTHERDISK (where ANOTHERDISK will be a path ending with your username); you do the following:

    	nice gtar cf - . | (cd /ANOTHERDISK/SUBDIRECTORY; nice gtar xfBp -)
    At this point make sure that the transfer worked--by comparing the old and new SUBDIRECTORY in size and content--before proceeding with:
    	rm -fr SUBDIRECTORY
    This will transfer ~/SUBDIRECTORY to /ANOTHERDISK and replace it with a link to its new (physical) location, so that the old path still works because the subdirectory still appears to be located in your home directory.

    Note that you should not move your ~/public_html subdirectory (or your web pages will ``disappear''). If you find that you are using a lot of space under that directory, it must be because you have lots of images or other non-HTML files there (e.g., PostScript). If that is the case, follow these instructions from the FAQ.

  • How can I have my quota increased?

    Quotas will be reevaluated about once a year to keep up with technology and global computing needs. (Note that current quotas are in most cases several times what they used to be sevearl years ago when they were disabled.) But an individual user's quota will not be increased by request because the whole point of quotas is to limit the amount of space used on a given disk. A lot of space is available on other disks without quotas. If you do not have access to such space, you should request it. However, if you feel that your quota is woefully inadequate (compared to others), you can make a case for an increase by detailing quantitatively all that must reside in your home directory. (There can be exceptional situations.)