<chapter id="sysresquotas-97946"><title>Managing Quotas
(Tasks)</title><highlights><para>This chapter describes how to set up and administer quotas for disk
space and inodes.</para><itemizedlist><para>For information associated with managing quotas, see the following:</para><listitem><para><olink targetptr="sysresquotas-67" remap="internal">Setting Up Quotas (Task
Map)</olink></para>
</listitem><listitem><para><olink targetptr="enmuy" remap="internal">Maintaining Quotas (Task Map)</olink></para>
</listitem>
</itemizedlist>
</highlights><sect1 id="sysresquotas-4"><title>What Are Quotas?</title><para>Quotas enable system administrators to control the
size of UFS file systems. Quotas limit the amount of disk space and the number
of inodes, which roughly corresponds to the number of files, that individual
users can acquire. For this reason, quotas are especially useful on the file
systems where user home directories reside. As a rule, the <filename>public</filename> and <filename>/tmp</filename> file systems usually do not benefit significantly by establishing
quotas.</para>
</sect1><sect1 id="sysresquotas-11993"><title>Using Quotas</title><para>Once quotas are in place, they can be changed to adjust the amount of
disk space or the number of inodes that users can consume. Additionally, quotas
can be added or removed as system needs change. For instructions on changing
quotas or the amount of time that quotas can be exceeded, disabling individual
quotas, or removing quotas from file systems, see <olink targetptr="sysresquotas-10332" remap="internal">Changing and Removing Quotas</olink>. </para><para>In addition, quota status can be monitored. Quota commands enable administrators
to display information about quotas on a file system, or search for users
who have exceeded their quotas. For procedures that describe how to use these
commands, see <olink targetptr="sysresquotas-36102" remap="internal">Checking Quotas</olink>.</para><sect2 id="sysresquotas-1"><title>Setting Soft Limits and Hard Limits for
Quotas</title><para>You can set both soft limits and hard limits. The system does not allow
a user to exceed his or her hard limit. However, a system administrator might
set a soft limit, which the user can temporarily exceed. The soft limit must
be less than the hard limit. </para><para>Once the user exceeds the soft limit, a quota timer begins. While the
quota timer is ticking, the user is allowed to operate above the soft limit
but cannot exceed the hard limit. Once the user goes below the soft limit,
the timer is reset. However, if the user's usage remains above the soft limit
when the timer expires, the soft limit is enforced as a hard limit. By default,
the soft limit timer is set to seven days. </para><para>The <literal>timeleft</literal> field in the <command>repquota</command> and <command>quota</command> commands shows the value of the timer.</para><para>For example, let's say a user has a soft limit of 10,000 blocks and
a hard limit of 12,000 blocks. If the user's block usage exceeds 10,000 blocks
and the seven-day timer is also exceeded, the user cannot allocate more disk
blocks on that file system until his or her usage drops below the soft limit. </para>
</sect2><sect2 id="sysresquotas-3"><title>The Difference Between Disk Block and File
Limits</title><para>A file system provides two resources to the user, blocks for data and
inodes for files. Each file consumes one inode. File data is stored in data
blocks. Data blocks are usually made up of 1Kbyte blocks.</para><para>Assuming no directories exist, a user can exceed his or her inode quota
by creating all empty files without using any blocks. A user can also use
one inode, yet exceed his or her block quota, by creating one file that is
large enough to consume all the data blocks in the user's quota. </para>
</sect2>
</sect1><sect1 id="sysresquotas-26007"><title>Setting Up Quotas</title><para>Setting up quotas involves these general steps: </para><orderedlist><listitem><para>Ensuring that quotas are enforced each time the system is rebooted
by adding a quota option to the <filename>/etc/vfstab</filename> file entries.
Also, creating a <filename>quotas</filename> file in the top-level directory
of the file system.</para>
</listitem><listitem><para>After you create a quota for one use, copying the quota as
a prototype to set up other user quotas.</para>
</listitem><listitem><para>Before you turn quotas on, checking the consistency of the
proposed quotas with the current disk usage to make sure that there are no
conflicts.</para>
</listitem><listitem><para>Turning on the quotas on for one or more file systems.</para>
</listitem>
</orderedlist><para>For specific information about these procedures, see <olink targetptr="sysresquotas-67" remap="internal">Setting Up Quotas (Task Map)</olink>.</para><para>The following table describes the commands that you
use to set up disk quotas.  </para><table frame="all" id="sysresquotas-16517"><title>Commands for Setting Up
Quotas</title><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="column1" colwidth="132*"/><colspec colname="column2" colwidth="230*"/><colspec colname="colspec0" colwidth="230.00*"/><thead><row rowsep="1"><entry colsep="1" rowsep="1"><para>Command</para>
</entry><entry colsep="1" rowsep="1"><para>Task</para>
</entry><entry colsep="1" rowsep="1"><para>Man Page</para>
</entry>
</row>
</thead><tbody><row><entry colsep="1" rowsep="1"><para> <command>edquota</command></para>
</entry><entry colsep="1" rowsep="1"><para>Sets the hard limits and soft limits on the number of inodes and the
amount of disk space for each user.</para>
</entry><entry colsep="1" rowsep="1"><para><olink targetdoc="refman" targetptr="edquota-1m" remap="external"><citerefentry><refentrytitle>edquota</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><command>quotacheck</command> </para>
</entry><entry colsep="1" rowsep="1"><para>Examines each mounted UFS file system, comparing the file system's current
disk usage against information stored in the file system's disk quota file.
Then, resolves inconsistencies</para>
</entry><entry colsep="1" rowsep="1"><para><olink targetdoc="refman" targetptr="quotacheck-1m" remap="external"><citerefentry><refentrytitle>quotacheck</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para> <command>quotaon</command></para>
</entry><entry colsep="1" rowsep="1"><para>Activates the quotas for the specified file systems.</para>
</entry><entry colsep="1" rowsep="1"><para><olink targetdoc="refman" targetptr="quotaon-1m" remap="external"><citerefentry><refentrytitle>quotaon</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry colsep="1" rowsep="1"><para><command>quota</command> </para>
</entry><entry colsep="1" rowsep="1"><para>Displays users' disk quotas on mounted file systems to verify that the
quotas have been correctly set up.</para>
</entry><entry colsep="1" rowsep="1"><para><olink targetdoc="refman" targetptr="quota-1m" remap="external"><citerefentry><refentrytitle>quota</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row>
</tbody>
</tgroup>
</table><sect2 id="sysresquotas-2"><title>Guidelines for Setting Up Quotas</title><para>Before you set up quotas, you need to determine how much disk space
and how many inodes to allocate to each user. If you want to ensure that the
total file system space is never exceeded, you can divide the total size of
the file system between the number of users. For example, if three users share
a 100-Mbyte slice and have equal disk space needs, you could allocate 33 Mbytes
to each user.</para><para>In environments where not all users are likely to
push their limits, you might want to set individual quotas so that they add
up to more than the total size of the file system. For example, if three users
share a 100-Mbyte slice, you could allocate 40 Mbytes to each user. </para><para>When you have established a quota for one user by using the <command>edquota</command> command, you can use this quota as a prototype to set the same
quota for other users on the same file system.</para><itemizedlist><para>Before
you turn on the quotas, do the following:</para><listitem><para>First, configure the UFS file systems for the
quotas.</para>
</listitem><listitem><para>Establish quotas for each user, and run the <command>quotacheck</command> command
to check for consistency between current disk usage and quota files.</para>
</listitem><listitem><para>Run the <command>quotacheck</command> command periodically
if systems are rebooted infrequently.</para>
</listitem>
</itemizedlist><para>The quotas you set up with
the <command>edquota</command> command are not enforced until you turn them
on by using the <command>quotaon</command> command. If you have properly configured
the quota files, the quotas are turned on automatically each time a system
is rebooted and the file system is mounted.     </para>
</sect2>
</sect1><sect1 id="sysresquotas-67"><title>Setting Up Quotas (Task Map)</title><informaltable frame="all"><tgroup cols="3" colsep="1" rowsep="1"><colspec colname="colspec1" colwidth="33*"/><colspec colname="colspec2" colwidth="33*"/><colspec colname="colspec3" colwidth="33*"/><thead><row><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>1. Configure a file system for quotas.</para>
</entry><entry><para>Edit the <filename>/etc/vfstab</filename> file so that quotas are activated
each time the file system is mounted. Also, create a <filename>quotas</filename> file. </para>
</entry><entry><para><olink targetptr="sysresquotas-61340" remap="internal">How to Configure File Systems
for Quotas</olink></para>
</entry>
</row><row><entry><para>2. Set up quotas for a user.</para>
</entry><entry><para>Use the <command>edquota</command> command to create disk quotas and
inode quotas for a single user account. </para>
</entry><entry><para><olink targetptr="sysresquotas-28657" remap="internal">How to Set Up Quotas for a User</olink></para>
</entry>
</row><row><entry><para>3. (Optional) Set up quotas for multiple users.</para>
</entry><entry><para> Use the <command>edquota</command> command to apply prototype quotas
to other user accounts. </para>
</entry><entry><para><olink targetptr="sysresquotas-63864" remap="internal">How to Set Up Quotas for Multiple
Users</olink></para>
</entry>
</row><row><entry><para>4. Check for  consistency.</para>
</entry><entry><para>Use the <command>quotacheck</command> command to compare quotas to current
disk usage for consistency across one or more file systems. </para>
</entry><entry><para><olink targetptr="sysresquotas-82495" remap="internal">How to Check Quota Consistency</olink></para>
</entry>
</row><row><entry><para>5. Turn on quotas.</para>
</entry><entry><para>Use the <command>quotaon</command> command to initiate quotas on one
or more file systems. </para>
</entry><entry><para><olink targetptr="sysresquotas-89063" remap="internal">How to Turn On Quotas</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable><task id="sysresquotas-61340"><title>How to Configure File Systems for Quotas</title><procedure>&rolestep.sgm;<step id="sysresquotas-step-8"><para>Edit the <filename>/etc/vfstab</filename> file and add <literal>rq</literal> to the <literal>mount options</literal> field for each UFS file
system that will have quotas.  </para>
</step><step id="sysresquotas-step-10"><para>Change directory to the root of the
file system that will have quotas.</para>
</step><step id="sysresquotas-step-11"><para>Create a file
named <filename>quotas</filename>. </para><screen># <userinput>touch quotas</userinput></screen>
</step><step id="sysresquotas-step-12"><para>Change permissions to read/write for
superuser access only.</para><screen># <userinput>chmod 600 quotas</userinput></screen>
</step>
</procedure><example id="emjew"><title>Configuring File Systems for Quotas</title><para>The following <filename>/etc/vfstab</filename> example shows that the <filename>/export/home</filename> directory from the system <filename>pluto</filename> is
mounted as an NFS file system on the local system. You can tell that quotas
are enabled by the <literal>rq</literal> entry under the <literal>mount options</literal> column.</para><screen># device   device    mount     FS    fsck   mount   mount
# to mount       to fsck  point     type   pass  at boot options
# pluto:/export/home -   /export/home nfs    -     yes    rq</screen><para>The following example line from the <filename>/etc/vfstab</filename> file
shows that the local <filename>/work</filename> directory is mounted with
quotas enabled, signified by the <literal>rq</literal> entry under the <literal>mount
options</literal> column.  </para><screen>#device     device        mount  FS   fsck  mount    mount
#to mount         to fsck      point  type  pass  at boot options
#/dev/dsk/c0t4d0s0 /dev/rdsk/c0t4d0s0 /work ufs  3    yes     rq</screen>
</example><taskrelated role="see-also"><itemizedlist><listitem><para><olink targetptr="sysresquotas-28657" remap="internal">How to Set Up Quotas
for a User</olink></para>
</listitem><listitem><para><olink targetptr="sysresquotas-63864" remap="internal">How to Set Up Quotas
for Multiple Users</olink></para>
</listitem><listitem><para><olink targetptr="sysresquotas-82495" remap="internal">How to Check Quota Consistency</olink></para>
</listitem><listitem><para><olink targetptr="sysresquotas-89063" remap="internal">How to Turn On Quotas</olink></para>
</listitem>
</itemizedlist>
</taskrelated>
</task><task id="sysresquotas-28657"><title>How to Set Up Quotas for a User</title><procedure>&rolestep.sgm;<step id="sysresquotas-step-16"><para>Use the quota editor to create a temporary
file that contains one line of quota information for each mounted UFS file
system that has a <filename>quotas</filename> file in the file system's root
directory.</para><screen># <userinput>edquota</userinput> <replaceable>username</replaceable></screen><para>where <replaceable>username</replaceable> is the user for whom you want
to set up quotas.</para>
</step><step id="sysresquotas-step-17"><para>Change the number of 1-Kbyte disk blocks,
both soft and hard, and the number of inodes, both soft and hard, from the
default of 0, to the quotas that you specify for each file system.</para>
</step><step id="sysresquotas-step-66"><para>Verify the user's quota.</para><screen># <userinput>quota</userinput> <userinput>-v</userinput> <replaceable>username</replaceable></screen><variablelist><varlistentry><term><option>v</option></term><listitem><para>Displays the user's quota information on all mounted file
systems where quotas exist.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>username</replaceable></term><listitem><para>Specifies the user name to view quota limits.</para>
</listitem>
</varlistentry>
</variablelist>
</step>
</procedure><example id="emjeu"><title>Setting Up Quotas for a User</title><para>The following example shows the contents of the temporary file opened
by <filename>edquota</filename> on a system where <filename>/files</filename> is
the only mounted file system that contains a <filename>quotas</filename> file
in the root directory.</para><screen>fs /files blocks (soft = 0, hard = 0) inodes (soft = 0, hard = 0)</screen><para>The following
example shows the same line in the temporary file after quotas have been set
up.  </para><screen>fs /files blocks (soft = 50, hard = 60) inodes (soft = 90, hard = 100)</screen>
</example>
</task><task id="sysresquotas-63864"><title>How to Set Up Quotas for Multiple Users</title><procedure>&rolestep.sgm;<step id="sysresquotas-step-23"><para>Use the quota editor to apply the quotas you already established
for a prototype user to the additional users that you specify.</para><screen># <userinput>edquota -p</userinput> <replaceable>prototype-user username ...</replaceable></screen><variablelist><varlistentry><term><replaceable>prototype-user</replaceable></term><listitem><para>Is the user name of the account for which you have set up
quotas. </para>
</listitem>
</varlistentry><varlistentry><term><replaceable>username ...</replaceable></term><listitem><para>Specifies one or more user names of additional accounts. More
than one user name is specified by separating each user name with a space.</para>
</listitem>
</varlistentry>
</variablelist>
</step>
</procedure><example id="emjet"><title>Setting Up Prototype Quotas for Multiple Users</title><para>The following example shows how
to apply the quotas established for user <literal>bob</literal> to users <literal>mary</literal> and <literal>john</literal>.    </para><screen># <userinput>edquota -p bob mary john</userinput></screen>
</example>
</task><task id="sysresquotas-82495"><title>How to Check Quota Consistency</title><tasksummary><para>The <command>quotacheck</command> command is run automatically when
a system is rebooted. You generally do not have to run the <command>quotacheck</command> command
on an empty file system with quotas. However, if you are setting up quotas
on a file system with existing files, you need to run the <command>quotacheck</command> command
to synchronize the quota database with the files or inodes that already exist
in the file system.</para><para>Also keep in mind that running the <command>quotacheck</command> command
on large file systems can be time-consuming.</para><note><para>To ensure accurate disk data, the file systems being checked should
be quiescent when you run the <command>quotacheck</command> command manually. </para>
</note>
</tasksummary><procedure>&rolestep.sgm;<step id="sysresquotas-step-27"><para>Run a consistency check on UFS file
systems. </para><screen># <userinput>quotacheck</userinput> [<userinput>-va</userinput>] <replaceable>filesystem</replaceable> </screen><variablelist><varlistentry><term><option>v</option></term><listitem><para>(Optional) Identifies the disk quotas for each user on a particular
file system. </para>
</listitem>
</varlistentry><varlistentry><term><option>a</option></term><listitem><para>Checks all file systems with an <literal>rq</literal> entry
in the <filename>/etc/vfstab</filename> file.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>filesystem</replaceable></term><listitem><para>Specifies the file system to check.</para>
</listitem>
</varlistentry>
</variablelist><para>See the <olink targetdoc="refman" targetptr="quotacheck-1m" remap="external"><citerefentry><refentrytitle>quotacheck</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> man page for more information.</para>
</step>
</procedure><example id="emjer"><title>Checking Quota Consistency</title><para>The following example shows how to check quotas for the <filename>/export/home</filename> file system on  the <filename>/dev/rdsk/c0t0d0s7</filename> slice.
The <filename>/export/home</filename> file system is the only file system
with an <literal>rq</literal> entry in the <filename>/etc/vfstab</filename> file.
   </para><screen># <userinput>quotacheck -va</userinput>
*** Checking quotas for /dev/rdsk/c0t0d0s7 (/export/home)</screen>
</example>
</task><task id="sysresquotas-89063"><title>How to Turn On Quotas</title><procedure>&rolestep.sgm;<step id="sysresquotas-step-31"><para>Turn on file system quotas.</para><screen># <userinput>quotaon</userinput> [<userinput>-v</userinput>] <userinput>-a</userinput> <replaceable>filesystem ...</replaceable></screen><variablelist><varlistentry><term><option>v</option></term><listitem><para>Displays a message for each file system after quotas are turned
on.</para>
</listitem>
</varlistentry><varlistentry><term><option>a</option></term><listitem><para>Turns on quotas for all file systems with an <literal>rq</literal> entry
in the <filename>/etc/vfstab</filename> file.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>filesystem ...</replaceable></term><listitem><para>Turns on quotas for one or more file systems that you specify.
More than one file system is specified by separating each file system name
with a space.</para>
</listitem>
</varlistentry>
</variablelist>
</step>
</procedure><example id="emjex"><title>Turning On Quotas</title><para>The following example shows how to turn quotas on for the file
systems on the <filename>/dev/dsk/c0t4d0s7</filename> and <filename>/dev/dsk/c0t3d0s7</filename> slices.  </para><screen># <userinput>quotaon -v /dev/dsk/c0t4d0s7 /dev/dsk/c0t3d0s7</userinput>
<userinput></userinput>/dev/dsk/c0t4d0s7: quotas turned on
/dev/dsk/c0t3d0s7: quotas turned on</screen>
</example>
</task>
</sect1><sect1 id="enmuy"><title>Maintaining Quotas (Task Map)</title><informaltable frame="all"><tgroup cols="3" colsep="1" rowsep="1"><colspec colname="colspec1" colwidth="33*"/><colspec colname="colspec2" colwidth="33*"/><colspec colname="colspec3" colwidth="33*"/><thead><row><entry><para>Task</para>
</entry><entry><para>Description</para>
</entry><entry><para>For Instructions</para>
</entry>
</row>
</thead><tbody><row><entry><para>Check for exceeded quotas.</para>
</entry><entry><para>Display the quotas and disk use for individual users on file systems
on which quotas have been activated by using the <command>quota</command> command.</para>
</entry><entry><para><olink targetptr="sysresquotas-81117" remap="internal">How to Check for Exceeded Quotas</olink></para>
</entry>
</row><row><entry><para>Check for quotas on a file system.</para>
</entry><entry><para>Display the quotas and disk use for all users on one or more file systems
by using the <command>repquota</command> command.</para>
</entry><entry><para><olink targetptr="sysresquotas-13508" remap="internal">How to Check Quotas on a File
System</olink></para>
</entry>
</row><row><entry><para>Change the soft limit default.</para>
</entry><entry><para>Change the length of time that users can exceed their disk space quotas
or inode quotas by using the <command>edquota</command> command.</para>
</entry><entry><para><olink targetptr="sysresquotas-53952" remap="internal">How to Change the Soft Limit Default</olink></para>
</entry>
</row><row><entry><para>Change quotas for a user.</para>
</entry><entry><para>Use the quota editor, <command>edquota</command>, to change quotas for
an individual user.</para>
</entry><entry><para><olink targetptr="sysresquotas-85417" remap="internal">How to Change Quotas for a User</olink></para>
</entry>
</row><row><entry><para>Disable quotas for a user.</para>
</entry><entry><para>Use the quota editor, <command>edquota</command>, to disable quotas
for an individual user.</para>
</entry><entry><para><olink targetptr="sysresquotas-22999" remap="internal">How to Disable Quotas for a User</olink></para>
</entry>
</row><row><entry><para>Turn off quotas.</para>
</entry><entry><para>Turn off quotas by using the <command>quotaoff</command> command.</para>
</entry><entry><para><olink targetptr="sysresquotas-45549" remap="internal">How to Turn Off Quotas</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="sysresquotas-36102"><title>Checking Quotas</title><para>After you have set up and turned
on disk quotas and inode quotas, you can check for users who exceed their
quotas. In addition, you can check quota information for entire file systems. </para><para>The following table describes the
commands that you use to check quotas.    </para><table frame="topbot" id="sysresquotas-39727"><title>Commands for Checking
Quotas</title><tgroup cols="2" colsep="0" rowsep="1"><colspec colname="column1" colwidth="132*"/><colspec colname="column2" colwidth="230*"/><thead><row><entry><para>Command</para>
</entry><entry><para>Task</para>
</entry>
</row>
</thead><tbody><row rowsep="0"><entry><para><olink targetdoc="refman" targetptr="quota-1m" remap="external"><citerefentry><refentrytitle>quota</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> </para>
</entry><entry><para>Displays user quotas and current disk use, and information about users
who are exceeding their quotas</para>
</entry>
</row><row><entry><para><olink targetdoc="refman" targetptr="repquota-1m" remap="external"><citerefentry><refentrytitle>repquota</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink> </para>
</entry><entry><para>Displays quotas, files, and the amount of space that is owned for specified
file systems</para>
</entry>
</row>
</tbody>
</tgroup>
</table><task id="sysresquotas-81117"><title>How to Check for Exceeded Quotas</title><tasksummary><para>You can display the quotas and disk use for individual users on file
systems on which quotas have been activated by using the <command>quota</command> command. </para>
</tasksummary><procedure>&rolestep.sgm;<step id="sysresquotas-step-35"><para>Display user quotas for mounted file
systems where quotas are enabled.</para><screen># <userinput>quota</userinput> [<userinput>-v</userinput>] <replaceable>username</replaceable></screen><variablelist><varlistentry><term><option>v</option></term><listitem><para>Displays one or more users' quotas on all mounted file systems
that have quotas.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>username</replaceable></term><listitem><para>Is the login name or UID of a user's account.</para>
</listitem>
</varlistentry>
</variablelist>
</step>
</procedure><example id="emjey"><title>Checking for Exceeded Quotas</title><para>The following example shows that the user account
identified by UID 301 has one 1&ndash;Kbyte quota but has not used any disk
space.      </para><screen># <userinput>quota -v 301</userinput>
Disk quotas for bob (uid 301):
Filesystem  usage  quota limit timeleft files quota  limit timeleft
/export/home   0      1     2             0      2      3</screen><variablelist><varlistentry><term><literal>Filesystem</literal></term><listitem><para>Is the mount point for the file system.</para>
</listitem>
</varlistentry><varlistentry><term><literal>usage</literal></term><listitem><para>Is the current block usage.</para>
</listitem>
</varlistentry><varlistentry><term><literal>quota</literal></term><listitem><para>Is the soft-block limit.</para>
</listitem>
</varlistentry><varlistentry><term><literal>limit</literal></term><listitem><para>Is the hard-block limit.</para>
</listitem>
</varlistentry><varlistentry><term><literal>timeleft</literal></term><listitem><para>Is the amount of time, in days, left on the quota timer.</para>
</listitem>
</varlistentry><varlistentry><term><literal>files</literal></term><listitem><para>Is the current inode usage.</para>
</listitem>
</varlistentry><varlistentry><term><literal>quota</literal></term><listitem><para>Is the soft-inode limit.</para>
</listitem>
</varlistentry><varlistentry><term><literal>limit</literal></term><listitem><para>Is the hard-inode limit.</para>
</listitem>
</varlistentry><varlistentry><term><literal>timeleft</literal></term><listitem><para>Is the amount of time, in days, left on the quota timer.</para>
</listitem>
</varlistentry>
</variablelist>
</example>
</task><task id="sysresquotas-13508"><title>How to Check Quotas on a File System</title><tasksummary><para>Display the quotas and disk use for all users on one or more file systems
by using the <command>repquota</command> command.  </para>
</tasksummary><procedure>&rolestep.sgm;<step id="sysresquotas-step-39"><para>Display all quotas for one or more file
systems, even if there is no usage.</para><screen># <userinput>repquota</userinput> [<userinput>-v</userinput>]  <userinput>-a</userinput> <replaceable>filesystem</replaceable></screen><variablelist><varlistentry><term><option>v</option></term><listitem><para>Reports on quotas for all users, even those users who do not
consume resources.</para>
</listitem>
</varlistentry><varlistentry><term><option>a</option></term><listitem><para>Reports on all file systems.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>filesystem</replaceable></term><listitem><para>Reports on the specified file system.</para>
</listitem>
</varlistentry>
</variablelist>
</step>
</procedure><example id="emjez"><title>Checking Quotas on a File System</title><para>The following example shows output from the <command>repquota</command> command
on a system that has quotas enabled on only one file system (<filename>/export/home</filename>).</para><screen># <userinput>repquota -va</userinput>
/dev/dsk/c0t3d0s7 (/export/home):
                  Block limits              File limits
User      used   soft   hard  timeleft  used  soft   hard  timeleft
#301  --            0      1   2.0 days         0      2      3  
#341  --    57     50     60   7.0 days  2      90    100  </screen><variablelist><varlistentry><term><literal>Block limits</literal></term><listitem><para>Definition</para>
</listitem>
</varlistentry><varlistentry><term><literal>used</literal></term><listitem><para>Is the current block usage.</para>
</listitem>
</varlistentry><varlistentry><term><literal>soft</literal></term><listitem><para>Is the soft-block limit.</para>
</listitem>
</varlistentry><varlistentry><term><literal>hard</literal></term><listitem><para>Is the hard-block limit.</para>
</listitem>
</varlistentry><varlistentry><term><literal>timeleft</literal></term><listitem><para>Is the amount of time, in days, left on the quota timer.</para>
</listitem>
</varlistentry><varlistentry><term><literal>File limits</literal></term><listitem><para>Definition</para>
</listitem>
</varlistentry><varlistentry><term><literal>used</literal></term><listitem><para>Is the current inode usage.</para>
</listitem>
</varlistentry><varlistentry><term><literal>soft</literal></term><listitem><para>Is the soft-inode limit.</para>
</listitem>
</varlistentry><varlistentry><term><literal>hard</literal></term><listitem><para>Is the hard-inode limit.</para>
</listitem>
</varlistentry><varlistentry><term><literal>timeleft</literal></term><listitem><para>Is the amount of time, in days, left on the quota timer.</para>
</listitem>
</varlistentry>
</variablelist>
</example>
</task>
</sect1><sect1 id="sysresquotas-10332"><title>Changing and Removing Quotas</title><para>You can change quotas to adjust
the amount of disk space or the number of inodes that users can consume. You
can also remove quotas, for individual users or from entire file systems,
as needed.</para><para>The following table describes the
commands that you use to change quotas or to remove quotas.</para><table frame="topbot" id="sysresquotas-30881"><title>Commands for Changing
Quotas and Removing Quotas</title><tgroup cols="3" colsep="0" rowsep="1"><colspec colname="column1" colwidth="117.53*"/><colspec colname="colspec0" colwidth="117.53*"/><colspec colname="column2" colwidth="248.94*"/><thead><row><entry><para>Command</para>
</entry><entry><para>Man Page</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row rowsep="0"><entry><para><command>edquota</command> </para>
</entry><entry><para><olink targetdoc="refman" targetptr="edquota-1m" remap="external"><citerefentry><refentrytitle>edquota</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry><entry><para>Changes the hard limits and soft limits on the number of inodes or amount
of disk space for each user. Also, changes the soft limit for each file system
with a quota. </para>
</entry>
</row><row><entry><para><command>quotaoff</command></para>
</entry><entry><para><olink targetdoc="refman" targetptr="quotaon-1m" remap="external"><citerefentry><refentrytitle>quotaon</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry><entry><para>Turns off quotas for specified file systems.</para>
</entry>
</row>
</tbody>
</tgroup>
</table><task id="sysresquotas-53952"><title>How to Change the Soft Limit Default</title><tasksummary><para>By default, users can exceed the soft time limits for their quotas for
one week. So, after a week of repeated violations of the soft time limits
of either disk space quotas or inode quotas, the system prevents users from
using any more inodes or disk blocks.      </para><para>You can change the length of time that users can exceed their disk space
quotas or inode quotas by using the <command>edquota</command> command. </para>
</tasksummary><procedure>&rolestep.sgm;<step id="sysresquotas-step-43"><para>Use the quota editor to create a temporary
file that contains soft time limits.</para><screen># <userinput>edquota -t</userinput></screen><para>where the <option>t</option> option specifies the editing of the soft
time limits for each file system.</para>
</step><step id="sysresquotas-step-44"><para>Change the time limits from 0 (the default)
to the time limits that you specify. So, use numbers and the keywords <literal>month</literal>, <literal>week</literal>, <literal>day</literal>, <literal>hour</literal>, <literal>min</literal>, or <literal>sec</literal>. </para><note><para>This procedure does not affect current quota violators.</para>
</note>
</step>
</procedure><example id="emjfa"><title>Changing the Soft Limit Default</title><para>The following example shows the contents of the temporary file opened
by the <command>edquota</command> command on a system where <filename>/export/home</filename> is the only mounted file system with quotas. The default value, <literal>0</literal>, means that the default time limit of one week is used.  </para><screen width="100">fs /export/home blocks time limit = 0 (default), files time limit = 0 (default)</screen><para>The following example shows the same temporary
file after the time limit for exceeding the blocks quota has been changed
to 2 weeks. Also, the time limit for exceeding the number of files has been
changed to 16 days.        </para><screen width="100">fs /export/home blocks time limit = 2 weeks, files time limit = 16 days</screen>
</example>
</task><task id="sysresquotas-85417"><title>How to Change Quotas for a User</title><procedure>&rolestep.sgm;<step id="sysresquotas-step-50"><para>Use the quota editor to open a temporary
file that contains one line for each mounted file system that has a <filename>quotas</filename> file in the file system's root directory.</para><screen># <userinput>edquota</userinput> <replaceable>username</replaceable></screen><para>where <replaceable>username</replaceable> specifies the user name whose
quota you want to change.</para><caution><para>You can specify multiple users as arguments to the <command>edquota</command> command. However, the user that this information belongs to, is
not displayed. To avoid confusion, specify only one user name.</para>
</caution>
</step><step id="sysresquotas-step-51"><para>Specify the number of 1-Kbyte disk blocks,
both soft and hard, and the number of inodes, both soft and hard.</para>
</step><step id="sysresquotas-step-70"><para>Verify that a user's quota has been correctly changed.   </para><screen># <userinput>quota</userinput> <userinput>-v</userinput> <replaceable>username</replaceable></screen><variablelist><varlistentry><term><option>v</option></term><listitem><para>Displays user quota information on all mounted file systems
with quotas enabled.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>username</replaceable></term><listitem><para>Specifies the user name whose quota you want to check.</para>
</listitem>
</varlistentry>
</variablelist>
</step>
</procedure><example id="emjfv"><title>Changing Quotas for a User</title><para>The following example shows the contents of the temporary file opened
by the <command>edquota</command> command. This temporary file is opened on
a system where <filename>/files</filename> is the only mounted file system
containing a <filename>quotas</filename> file in the file system's root directory.</para><screen width="100">fs /files blocks (soft = 0, hard = 0) inodes (soft = 0, hard = 0)</screen><para>The following output shows the same temporary file after quotas have
been changed. </para><screen width="100">fs /files blocks (soft = 0, hard = 500) inodes (soft = 0, hard = 100)</screen>
</example><example id="enfms"><title>Verifying That Hard Quotas Have Been Changed</title><para>The following
example shows how to verify that the hard quotas for user <filename>smith</filename> have
been changed to 500 1-Kbyte blocks, and 100 inodes.       </para><screen width="100"># <userinput>quota -v smith</userinput>
Disk quotas for smith (uid 12):
Filesystem  usage  quota  limit  timeleft  files  quota  limit  timeleft
 
  /files     1       0     500              1       0     100</screen>
</example>
</task><task id="sysresquotas-22999"><title>How to Disable Quotas for a User</title><procedure>&rolestep.sgm;<step id="sysresquotas-step-57"><para>Use the quota editor to create a temporary
file containing one line for each mounted file system that has a <filename>quotas</filename> file in its top-level directory.</para><screen># <userinput>edquota</userinput> <replaceable>username</replaceable></screen><para>Where <replaceable>username</replaceable> specifies the user name whose
quota you want to disable.</para><caution><para>You can specify multiple users as arguments to the <command>edquota</command> command. However, the user that this information belongs to, is
not displayed. To avoid confusion, specify only one user name.</para>
</caution>
</step><step id="sysresquotas-step-58"><para>Change the number of 1-Kbyte disk blocks,
both soft and hard, and the number of inodes, both soft and hard, to 0.</para><note><para>Ensure that you change the values to zero. Do <emphasis>not</emphasis> delete
the line from the text file.</para>
</note>
</step><step id="sysresquotas-step-71"><para>Verify that you have disabled a user's
quota.</para><screen># <userinput>quota -v</userinput> <replaceable>username</replaceable></screen><variablelist><varlistentry><term><option>v</option></term><listitem><para>Displays user quota information on all mounted file systems
with quotas enabled.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>username</replaceable></term><listitem><para>Specifies the user name (UID) whose quota you want to check.</para>
</listitem>
</varlistentry>
</variablelist>
</step>
</procedure><example id="emjfz"><title>Disabling Quotas for a User</title><para>The following example shows the contents of the temporary file opened
by the <command>edquota</command> command on a system where <filename>/files</filename> is
the only mounted file system that contains a quotas file in the file system's
root directory.</para><screen width="100">fs /files blocks (soft = 50, hard = 60) inodes (soft = 90, hard = 100)</screen><para>The following example shows the same temporary file after quotas
have been disabled.       </para><screen width="100">fs /files blocks (soft = 0, hard = 0) inodes (soft = 0, hard = 0)</screen>
</example>
</task><task id="sysresquotas-45549"><title>How to Turn Off Quotas</title><procedure>&rolestep.sgm;<step id="sysresquotas-step-64"><para>Turn off file system quotas.</para><screen># <userinput>quotaoff</userinput> [<userinput>-v</userinput>] <userinput>-a</userinput> <replaceable>filesystem ...</replaceable></screen><variablelist><varlistentry><term><option>v</option></term><listitem><para>Displays a message from each file system when quotas are turned
off.</para>
</listitem>
</varlistentry><varlistentry><term><option>a</option></term><listitem><para>Turns off quotas for all file systems.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>filesystem</replaceable></term><listitem><para>Turns off quotas for one or more file systems that you specify.
More than one file system is specified by separating each file system name
with a space.</para>
</listitem>
</varlistentry>
</variablelist>
</step>
</procedure><example id="emjfr"><title>Turning Off Quotas</title><para>The following example shows how to turn off the quotas for the <filename>/export/home</filename> file system.</para><screen># <userinput>quotaoff -v /export/home</userinput>
/export/home: quotas turned off</screen>
</example>
</task>
</sect1>
</chapter>