xref: /freebsd/usr.sbin/edquota/edquota.8 (revision aa0a1e58)
1.\" Copyright (c) 1983, 1990, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Robert Elz at The University of Melbourne.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 4. Neither the name of the University nor the names of its contributors
16.\"    may be used to endorse or promote products derived from this software
17.\"    without specific prior written permission.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.\"	@(#)edquota.8	8.1 (Berkeley) 6/6/93
32.\" $FreeBSD$
33.\"
34.Dd June 6, 1993
35.Dt EDQUOTA 8
36.Os
37.Sh NAME
38.Nm edquota
39.Nd edit user quotas
40.Sh SYNOPSIS
41.Nm
42.Op Fl uh
43.Op Fl f Ar fspath
44.Op Fl p Ar proto-username
45.Ar username ...
46.Nm
47.Op Fl u
48.Fl e
49.Sm off
50.Ar fspath Op : Ar bslim Op : Ar bhlim Op : Ar islim Op : Ar ihlim
51.Sm on
52.Op Fl e Ar ...
53.Ar username ...
54.Nm
55.Fl g
56.Op Fl h
57.Op Fl f Ar fspath
58.Op Fl p Ar proto-groupname
59.Ar groupname ...
60.Nm
61.Fl g
62.Fl e
63.Sm off
64.Ar fspath Op : Ar bslim Op : Ar bhlim Op : Ar islim Op : Ar ihlim
65.Sm on
66.Op Fl e Ar ...
67.Ar groupname ...
68.Nm
69.Fl t
70.Op Fl u
71.Op Fl f Ar fspath
72.Nm
73.Fl t
74.Fl g
75.Op Fl f Ar fspath
76.Sh DESCRIPTION
77The
78.Nm
79utility is a quota editor.
80By default, or if the
81.Fl u
82flag is specified,
83one or more users may be specified on the command line.
84For each user a temporary file is created
85with an
86.Tn ASCII
87representation of the current
88disk quotas for that user.
89The list of file systems with user quotas is determined from
90.Pa /etc/fstab .
91An editor is invoked on the
92.Tn ASCII
93file.
94The editor invoked is
95.Xr vi 1
96unless the environment variable
97.Ev EDITOR
98specifies otherwise.
99.Pp
100The quotas may then be modified, new quotas added, etc.
101Block quotas can be specified in bytes (B), kilobytes (K),
102megabytes (M), terabytes (T), petabytes (P), or exabytes (E).
103If no units are specified, kilobytes are assumed.
104Inode quotas can be specified in kiloinodes (K),
105megainodes (M), terainodes (T), petainodes (P), or exainodes (E).
106If no units are specified, the number of inodes specified are used.
107If the
108.Fl h
109flag is specified, the editor will always display the
110block usage and limits in a more human readable format
111rather than displaying them in the historic kilobyte format.
112Setting a quota to zero indicates that no quota should be imposed.
113Setting a hard limit to one indicates that no allocations should
114be permitted.
115Setting a soft limit to one with a hard limit of zero
116indicates that allocations should be permitted only on
117a temporary basis (see
118.Fl t
119below).
120The current usage information in the file is for informational purposes;
121only the hard and soft limits can be changed.
122.Pp
123On leaving the editor,
124.Nm
125reads the temporary file and modifies the binary
126quota files to reflect the changes made.
127.Pp
128If the
129.Fl p
130option is specified,
131.Nm
132will duplicate the quotas of the prototypical user
133specified for each user specified.
134This is the normal mechanism used to
135initialize quotas for groups of users.
136If the user given to assign quotas to is a numerical uid
137range (e.g.\& 1000-2000), then
138.Nm
139will duplicate the quotas of the prototypical user
140for each uid in the range specified.
141This allows
142for easy setup of default quotas for a group of users.
143The uids in question do not have to be currently assigned in
144.Pa /etc/passwd .
145.Pp
146If one or more
147.Fl e
148.Sm off
149.Ar fspath Op : Ar bslim Op : Ar bhlim Op : Ar islim Op : Ar ihlim
150.Sm on
151options are specified,
152.Nm
153will non-interactively set quotas defined by
154.Ar bslim , bhlim , islim ,
155and
156.Ar ihlim
157on each particular file system referenced by
158.Ar fspath .
159Here
160.Ar bslim
161is the soft limit on the number of blocks,
162.Ar bhlim
163is the hard limit on the number of blocks,
164.Ar islim
165is the soft limit on the number of files, and
166.Ar ihlim
167is the hard limit on the number of files.
168If any of the
169.Ar bslim , bhlim , islim ,
170and
171.Ar ihlim
172values is omitted, it is assumed to be zero, therefore
173indicating that no particular quota should be imposed.
174Block quotas can be specified in bytes (B), kilobytes (K),
175megabytes (M), terabytes (T), petabytes (P), or exabytes (E).
176If no units are specified, kilobytes are assumed.
177Inode quotas can be specified in kiloinodes (K),
178megainodes (M), terainodes (T), petainodes (P), or exainodes (E).
179If no units are specified, the number of inodes specified are used.
180.Pp
181If invoked with the
182.Fl f
183option,
184.Nm
185will read and modify quotas on the file system specified by
186.Ar fspath
187only.
188The
189.Ar fspath
190argument may be either a special device
191or a file system mount point.
192The primary purpose of this option is to set the scope for the
193.Fl p
194option, which would overwrite quota records on every
195file system with quotas otherwise.
196.Pp
197If the
198.Fl g
199flag is specified,
200.Nm
201is invoked to edit the quotas of
202one or more groups specified on the command line.
203The
204.Fl p
205flag can be specified in conjunction with
206the
207.Fl g
208flag to specify a prototypical group
209to be duplicated among the listed set of groups.
210Similarly,
211.Fl e
212flag can be specified in conjunction with
213the
214.Fl g
215flag to non-interactively set-up quotas on the listed set
216of groups.
217.Pp
218Users are permitted to exceed their soft limits
219for a grace period that may be specified per file system.
220Once the grace period has expired,
221the soft limit is enforced as a hard limit.
222The default grace period for a file system is specified in
223.In ufs/ufs/quota.h .
224The
225.Fl t
226flag can be used to change the grace period.
227By default, or when invoked with the
228.Fl u
229flag,
230the grace period is set for all the file systems with user
231quotas specified in
232.Pa /etc/fstab .
233When invoked with the
234.Fl g
235flag the grace period is
236set for all the file systems with group quotas specified in
237.Pa /etc/fstab .
238The grace period may be specified in days, hours, minutes, or seconds.
239Setting a grace period to zero indicates that the default
240grace period should be imposed.
241Setting a grace period to one second indicates that no
242grace period should be granted.
243Quotas must be turned off for the file system and
244then turned back on for the new grace period to take effect.
245.Pp
246Only the super-user may edit quotas.
247.Sh FILES
248.Bl -tag -width quota.group -compact
249.It Pa quota.user
250at the file system root with user quotas
251.It Pa quota.group
252at the file system root with group quotas
253.It Pa /etc/fstab
254to find file system names and locations
255.El
256.Sh DIAGNOSTICS
257Various messages about inaccessible files; self-explanatory.
258.Sh SEE ALSO
259.Xr quota 1 ,
260.Xr quotactl 2 ,
261.Xr fstab 5 ,
262.Xr quotacheck 8 ,
263.Xr quotaon 8 ,
264.Xr repquota 8
265