xref: /freebsd/usr.sbin/edquota/edquota.8 (revision 4b9d6057)
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.\" 3. 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.Dd June 6, 1993
32.Dt EDQUOTA 8
33.Os
34.Sh NAME
35.Nm edquota
36.Nd edit user quotas
37.Sh SYNOPSIS
38.Nm
39.Op Fl uh
40.Op Fl f Ar fspath
41.Op Fl p Ar proto-username
42.Ar username ...
43.Nm
44.Op Fl u
45.Fl e
46.Sm off
47.Ar fspath Op : Ar bslim Op : Ar bhlim Op : Ar islim Op : Ar ihlim
48.Sm on
49.Op Fl e Ar ...
50.Ar username ...
51.Nm
52.Fl g
53.Op Fl h
54.Op Fl f Ar fspath
55.Op Fl p Ar proto-groupname
56.Ar groupname ...
57.Nm
58.Fl g
59.Fl e
60.Sm off
61.Ar fspath Op : Ar bslim Op : Ar bhlim Op : Ar islim Op : Ar ihlim
62.Sm on
63.Op Fl e Ar ...
64.Ar groupname ...
65.Nm
66.Fl t
67.Op Fl u
68.Op Fl f Ar fspath
69.Nm
70.Fl t
71.Fl g
72.Op Fl f Ar fspath
73.Sh DESCRIPTION
74The
75.Nm
76utility is a quota editor.
77By default, or if the
78.Fl u
79flag is specified,
80one or more users may be specified on the command line.
81For each user a temporary file is created
82with an
83.Tn ASCII
84representation of the current
85disk quotas for that user.
86The list of file systems with user quotas is determined from
87.Pa /etc/fstab .
88An editor is invoked on the
89.Tn ASCII
90file.
91The editor invoked is
92.Xr vi 1
93unless the environment variable
94.Ev EDITOR
95specifies otherwise.
96.Pp
97The quotas may then be modified, new quotas added, etc.
98Block quotas can be specified in bytes (B), kilobytes (K),
99megabytes (M), terabytes (T), petabytes (P), or exabytes (E).
100If no units are specified, kilobytes are assumed.
101Inode quotas can be specified in kiloinodes (K),
102megainodes (M), terainodes (T), petainodes (P), or exainodes (E).
103If no units are specified, the number of inodes specified are used.
104If the
105.Fl h
106flag is specified, the editor will always display the
107block usage and limits in a more human readable format
108rather than displaying them in the historic kilobyte format.
109Setting a quota to zero indicates that no quota should be imposed.
110Setting a hard limit to one indicates that no allocations should
111be permitted.
112Setting a soft limit to one with a hard limit of zero
113indicates that allocations should be permitted only on
114a temporary basis (see
115.Fl t
116below).
117The current usage information in the file is for informational purposes;
118only the hard and soft limits can be changed.
119.Pp
120On leaving the editor,
121.Nm
122reads the temporary file and modifies the binary
123quota files to reflect the changes made.
124.Pp
125If the
126.Fl p
127option is specified,
128.Nm
129will duplicate the quotas of the prototypical user
130specified for each user specified.
131This is the normal mechanism used to
132initialize quotas for groups of users.
133If the user given to assign quotas to is a numerical uid
134range (e.g.\& 1000-2000), then
135.Nm
136will duplicate the quotas of the prototypical user
137for each uid in the range specified.
138This allows
139for easy setup of default quotas for a group of users.
140The uids in question do not have to be currently assigned in
141.Pa /etc/passwd .
142.Pp
143If one or more
144.Fl e
145.Sm off
146.Ar fspath Op : Ar bslim Op : Ar bhlim Op : Ar islim Op : Ar ihlim
147.Sm on
148options are specified,
149.Nm
150will non-interactively set quotas defined by
151.Ar bslim , bhlim , islim ,
152and
153.Ar ihlim
154on each particular file system referenced by
155.Ar fspath .
156Here
157.Ar bslim
158is the soft limit on the number of blocks,
159.Ar bhlim
160is the hard limit on the number of blocks,
161.Ar islim
162is the soft limit on the number of files, and
163.Ar ihlim
164is the hard limit on the number of files.
165If any of the
166.Ar bslim , bhlim , islim ,
167and
168.Ar ihlim
169values is omitted, it is assumed to be zero, therefore
170indicating that no particular quota should be imposed.
171Block quotas can be specified in bytes (B), kilobytes (K),
172megabytes (M), terabytes (T), petabytes (P), or exabytes (E).
173If no units are specified, kilobytes are assumed.
174Inode quotas can be specified in kiloinodes (K),
175megainodes (M), terainodes (T), petainodes (P), or exainodes (E).
176If no units are specified, the number of inodes specified are used.
177.Pp
178If invoked with the
179.Fl f
180option,
181.Nm
182will read and modify quotas on the file system specified by
183.Ar fspath
184only.
185The
186.Ar fspath
187argument may be either a special device
188or a file system mount point.
189The primary purpose of this option is to set the scope for the
190.Fl p
191option, which would overwrite quota records on every
192file system with quotas otherwise.
193.Pp
194If the
195.Fl g
196flag is specified,
197.Nm
198is invoked to edit the quotas of
199one or more groups specified on the command line.
200The
201.Fl p
202flag can be specified in conjunction with
203the
204.Fl g
205flag to specify a prototypical group
206to be duplicated among the listed set of groups.
207Similarly,
208.Fl e
209flag can be specified in conjunction with
210the
211.Fl g
212flag to non-interactively set-up quotas on the listed set
213of groups.
214.Pp
215Users are permitted to exceed their soft limits
216for a grace period that may be specified per file system.
217Once the grace period has expired,
218the soft limit is enforced as a hard limit.
219The default grace period for a file system is specified in
220.In ufs/ufs/quota.h .
221The
222.Fl t
223flag can be used to change the grace period.
224By default, or when invoked with the
225.Fl u
226flag,
227the grace period is set for all the file systems with user
228quotas specified in
229.Pa /etc/fstab .
230When invoked with the
231.Fl g
232flag the grace period is
233set for all the file systems with group quotas specified in
234.Pa /etc/fstab .
235The grace period may be specified in days, hours, minutes, or seconds.
236Setting a grace period to zero indicates that the default
237grace period should be imposed.
238Setting a grace period to one second indicates that no
239grace period should be granted.
240Quotas must be turned off for the file system and
241then turned back on for the new grace period to take effect.
242.Pp
243Only the super-user may edit quotas.
244.Sh FILES
245.Bl -tag -width quota.group -compact
246.It Pa quota.user
247at the file system root with user quotas
248.It Pa quota.group
249at the file system root with group quotas
250.It Pa /etc/fstab
251to find file system names and locations
252.El
253.Sh DIAGNOSTICS
254Various messages about inaccessible files; self-explanatory.
255.Sh SEE ALSO
256.Xr quota 1 ,
257.Xr quotactl 2 ,
258.Xr fstab 5 ,
259.Xr quotacheck 8 ,
260.Xr quotaon 8 ,
261.Xr repquota 8
262