Disk Quotas
Your disk quota is a limit on the amount of file space you
can use for your CS lab account. If you exceed your disk quota, and
do not correct the problem, you will soon find yourself unable to
create new files and even unable to log in as usual. This page describes
For help on any of this material, speak to a
CS lab assistant.
How to check your disk quota
"Checking your disk quota" means comparing the amount of file space
you are currently using against the disk quota limitation. You can
check your disk quota at any time using the following Linux command.
% quota -v
Note: Do not type in the % character in
the line above. It represents the "shell prompt" that Linux prints
for you in a "shell window" where you can enter commands.
This command prints size information in a tabular format. Here's
an example:
cs8.cs.stolaf.edu% quota -v
Disk quotas for user cs172 (uid 203):
Filesystem blocks quota limit grace files quota limit grace
nic.stolaf.edu:/export/home/accserv1
36395 40000 50000 1773 40000 50000
nic.stolaf.edu:/export/home/mathserv
36395 40000 50000 1773 40000 50000
nic.stolaf.edu:/export/home/accserv2
36395 40000 50000 1773 40000 50000
- The
blocks column lists how much disk space your
files are taking up. 1000 blocks represents 1 Megabyte (1 MB) of disk
space.
- The next column,
quota, lists is your disk quota, the
limitation you should stay within.
- The next column,
limit, shows the absolute maximum file
space your files may occupy at any time. The difference between
quota and limit is leeway temporarily
permitted by the system.
- The next column,
grace, lists how much temporary leeway time
you have remaining (see limit section above).
- The remaining columns concern the number of files you may
have. This kind of quota is rarely an issue.
As in the example, the values are repeated in multiple lines; this is
due to the way that the system is set up, and does not represent any
kind of problem to worry about.
If you are over your disk quota, then there will be an
asterisk next to the number of blocks, and there will be a time value
(e.g., 4.3 days or 17.2 hours) in the grace column for blocks.
Note: The quota -v command does two things:
it shows information about your current disk usage and quota, as
described above; and it informs
Linux whether or not you are currently over your disk quota. Thus, if
you create or delete files, putting you over or under your disk quota,
the system won't realize it until you enter quota -v (or
log in again).
How to avoid exceeding your disk quota
The primary way to avoid exceeding your disk quota is to delete
files you no longer need. The Linux file deletion command is called
rm; for example, if you enter
% rm myfile.txt tmpfile
then the files named myfile.txt and tmpfile
will be deleted, which reduces the total space you use relative to
your disk quota.
Note: Use the % quota -v
command to see the effect of deleting files on your disk space usage.
What are some good files to delete? Here are some examples:
- Files with names ending in a
~ (tilde) character.
These are temporary backup files created automatically by
emacs when you perform a "save" of a file. It's nice to
have those backups in case you "save" a version
of your file in which you inadvertently made major mistakes (e.g.,
erasing most of the contents...): the ~ file contains
the previous "saved" version of that file. But if you don't need that
backup any more, you can delete the ~ files.
- Files named
core. These occasionally arise from
various error situations, and they may take up enormous amounts of
space. They aren't needed except perhaps by the most advanced
programmers.
- Object and executable files from C++ compilations---Software Design
students know what this means.
- Java byte code (
.class) files---Java programmers know
what this means.
If you have many files to delete, you can use a wildcard
character to specify many files at once---but be
careful! For example,
% rm myfile*
will delete all files whose names begin with the six
characters myfile; this would include
myfile.txt, myfile.doc, etc., as well as a
file named myfile. Careful use of wildcard characters
can help you "clean up" your files quickly.
The problem with wildcard characters is that you might delete too
much! For example, consider the command
% rm *
The command above would delete all of your files!
Always be careful with wildcard characters
in a rm command---even the most skilled of us make big
mistakes with wildcard characters sometimes. See the purge command below for information
about a safer way to delete many unneeded files.
The purge command for finding
files to delete
The purge command (a locally written Linux command)
is a safe way to find files that you may want to delete, and to
help you to delete those files. To try it, enter the command
% purge
This command will print a list of files that appear to be good
candidates for deletion, such as those listed in the section above.
It will also state how much disk space those files take up.
Then, the command will give you three options:
Remove these files?
1) remove all files now
2) prompt whether to remove each file
Q) quit (default)
Your choice:
Enter the character 1 to delete all of the files that
were listed. (Be careful with option 1!)
The option 2 lists
each of the files in order, and gives you a chance to decide on a
file-by-file basis which ones to delete and which ones to keep. The
quit option Q doesn't delete anything, and simply returns you
to the shell prompt %.
Note: If the purge command is not defined for you,
send e-mail to cs@stolaf.edu for help (a
CS lab assistant may also be able to help).
How to set your Mozilla preferences to help
you avoid exceeding your disk quota
Browsers such as Mozilla are designed to save copies of recently
visited web pages, so that you can retrieve those pages quickly
without having to go over the network again. The saved copies are
stored in an area called a cache. Mozilla uses two
caches: one in main memory, and one on the disk. The disk cache
counts against your disk quota, and it can get quite large.
Mozilla allows you to decide how large your caches can get. The
default disk cache size is very high at this writing (Fall,
2003): 50 Megabytes, probably several times larger than your entire
disk quota!
To remedy this problem, start up Mozilla, then
choose Edit -> Preferences (i.e., choose
Preferences from the Edit menu).
Click on the boxed "+" sign next to Advanced
within the Category section. This
will display options for Advanced. Now, click on
Cache.
In the Cache display, click on the Clear
Disk Cache button.
Also, check the Disk Cache: entry blank---it may
read something like 50000. Change this value to a significantly
smaller value, e.g., 2000. (If you have trouble getting the entry
blank to recognize keyboard characters when entering this new value,
send e-mail to cs@stolaf.edu; a
CS lab assistant may also be able to help.)
Finally, click on the OK button at the bottom of
the Cache display to record your new Disk
Cache value.
Notes: The memory cache has no effect on your disk quota, and
you probably won't need to adjust the memory cache size.
How to recover if you do exceed your disk quota
If you exceed your disk quota and do not delete enough files to
remedy the situation before the grace period expires (see
checking your disk quota above), then Linux will
prevent you from creating any more new files until you reduce your
disk space usage. Unfortunately, this prevents you from logging in as
normal at a CS lab machine, because starting up a new Linux desktop
requires creating some files. A symptom of this problem is: correct
entry of username and password, but the system does not let you log in
and simply shows the username/password form again.
So, how can you delete files if you can't log in as normal? The
solution is to find an alternate way to log in. For example, you can
remotely log in from a networked Windows computer on
campus using the TeraTerm Pro application. This program shows a form
requesting a particular computer on campus: you can enter the full
name of a CS lab machine, such as cs5.cs.stolaf.edu, and
click "ok". Next, you will get a new window prompting you for
username and password. This login will succeed, and you will get a
shell prompt in the new window for entering Linux commands on that
computer. You can now proceed to delete files using
rm
and/or purge as described above,
checking your work with quota -v,
until you are using fewer disk blocks than your quota. Thereafter,
you will be able to log in again as normal.
|