old-www/HOWTO/Quota-4.html

103 lines
3.4 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
<TITLE>Quota mini-HOWTO: Quota setup: tools</TITLE>
<LINK HREF="Quota-5.html" REL=next>
<LINK HREF="Quota-3.html" REL=previous>
<LINK HREF="Quota.html#toc4" REL=contents>
</HEAD>
<BODY>
<A HREF="Quota-5.html">Next</A>
<A HREF="Quota-3.html">Previous</A>
<A HREF="Quota.html#toc4">Contents</A>
<HR>
<H2><A NAME="s4">4. Quota setup: tools</A></H2>
<P>
<P>This operation is performed with the edquota command (`man edquota` for details).
<P>
<H2><A NAME="ss4.1">4.1 Assigning quota for a particular user</A>
</H2>
<P>
<P>Here's an example. I have a user with the login id bob on my system. The
command "edquota -u bob" takes me into vi (or editor specified in my $EDITOR
environment variable) to edit quota for user bob on each partition that has
quota enabled:
<HR>
<PRE>
Quotas for user bob:
/dev/hda3: blocks in use: 2594, limits (soft = 5000, hard = 6500)
inodes in use: 356, limits (soft = 1000, hard = 1500)
</PRE>
<HR>
<P>"blocks in use" is the total number of blocks (in kilobytes) a user has
consumed on a partition.
<P>"inodes in use" is the total number of inodes a user has consumed on a partition.
<H2><A NAME="ss4.2">4.2 Assigning quota for a particular group</A>
</H2>
<P>
<P>Now I have a group games on my system. "edquota -g games" takes me into
the vi editor again to edit quota for the group games:
<HR>
<PRE>
Quotas for group games:
/dev/hda4: blocks in use: 5799, limits (soft = 8000, hard = 10000)
inodes in use: 1454, limits (soft = 3000, hard = 4000)
</PRE>
<HR>
<H2><A NAME="ss4.3">4.3 Assigning quota for a bunch of users with the same value</A>
</H2>
<P>
<P>To rapidly set quotas for, say 100 users, on my system to the same value
as my user bob, I would first edit bob's quota information by hand, then execute:
<HR>
<PRE>
edquota -p bob `awk -F: '$3 &gt; 499 {print $1}' /etc/passwd`
</PRE>
<HR>
<P>assuming that you are using csh, and that you assign your user UID's starting
with 500.
<P>In addition to edquota, there are 3 terms which you should familiarize
yourself with: Soft Limit, Hard Limit, and Grace Period.
<H2><A NAME="ss4.4">4.4 Soft Limit</A>
</H2>
<P>
<P>_Soft limit_ indicates the maximum amount of disk usage a quota user has
on a partition. When combined with grace period, it acts as the border line,
which a quota user is issued warnings about his impending quota violation when
passed.
<H2><A NAME="ss4.5">4.5 Hard Limit</A>
</H2>
<P>
<P>Hard limit works only when grace period is set. It specifies the absolute
limit on the disk usage, which a quota user can't go beyond his hard limit.
<H2><A NAME="ss4.6">4.6 Grace Period</A>
</H2>
<P>
<P>Executed with the command "edquota -t", grace period is a time limit before
the soft limit is enforced for a file system with quota enabled. Time units
of sec(onds), min(utes), hour(s), day(s), week(s), and month(s) can be used.
This is what you'll see with the command "edquota -t":
<HR>
<PRE>
Time units may be: days, hours, minutes, or seconds
Grace period before enforcing soft limits for users:
/dev/hda2: block grace period: 0 days, file grace period: 0 days
</PRE>
<HR>
<P>Change the 0 days part to any length of time you feel reasonable. I personally
would choose 7 days (or 1 week).
<HR>
<A HREF="Quota-5.html">Next</A>
<A HREF="Quota-3.html">Previous</A>
<A HREF="Quota.html#toc4">Contents</A>
</BODY>
</HTML>