Initial import from FreeBSD RELENG_4:
[dragonfly.git] / usr.sbin / edquota / edquota.8
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. All advertising materials mentioning features or use of this software
16 .\"    must display the following acknowledgement:
17 .\"     This product includes software developed by the University of
18 .\"     California, Berkeley and its contributors.
19 .\" 4. Neither the name of the University nor the names of its contributors
20 .\"    may be used to endorse or promote products derived from this software
21 .\"    without specific prior written permission.
22 .\"
23 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 .\" SUCH DAMAGE.
34 .\"
35 .\"     @(#)edquota.8   8.1 (Berkeley) 6/6/93
36 .\" $FreeBSD: src/usr.sbin/edquota/edquota.8,v 1.9.2.3 2002/10/11 14:25:39 sobomax Exp $
37 .\"
38 .Dd June 6, 1993
39 .Dt EDQUOTA 8
40 .Os
41 .Sh NAME
42 .Nm edquota
43 .Nd edit user quotas
44 .Sh SYNOPSIS
45 .Nm
46 .Op Fl u
47 .Op Fl f Ar fspath
48 .Op Fl p Ar proto-username
49 .Ar username ...
50 .Nm
51 .Op Fl u
52 .Fl e Ar fspath Ns Op : Ns Ar bslim Ns Op : Ns Ar bhlim Ns Op : Ns Ar islim Ns Op : Ns Ar ihlim
53 .Op Fl e Ar ...
54 .Ar username ...
55 .Nm
56 .Fl g
57 .Op Fl f Ar fspath
58 .Op Fl p Ar proto-groupname
59 .Ar groupname ...
60 .Nm
61 .Fl g
62 .Fl e Ar fspath Ns Op : Ns Ar bslim Ns Op : Ns Ar bhlim Ns Op : Ns Ar islim Ns Op : Ns Ar ihlim
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
74 .Nm Edquota
75 is a quota editor.
76 By default, or if the
77 .Fl u
78 flag is specified,
79 one or more users may be specified on the command line.
80 For each user a temporary file is created
81 with an
82 .Tn ASCII
83 representation of the current
84 disk quotas for that user.
85 The list of filesystems with user quotas is determined from
86 .Pa /etc/fstab .
87 An editor is invoked on the
88 .Tn ASCII
89 file.
90 The editor invoked is
91 .Xr vi 1
92 unless the environment variable
93 .Ev EDITOR
94 specifies otherwise.
95 .Pp
96 The quotas may then be modified, new quotas added, etc.
97 Setting a quota to zero indicates that no quota should be imposed.
98 Setting a hard limit to one indicates that no allocations should
99 be permitted.
100 Setting a soft limit to one with a hard limit of zero
101 indicates that allocations should be permitted only on
102 a temporary basis (see
103 .Fl t
104 below).
105 The current usage information in the file is for informational purposes;
106 only the hard and soft limits can be changed.
107 .Pp
108 On leaving the editor,
109 .Nm
110 reads the temporary file and modifies the binary
111 quota files to reflect the changes made.
112 .Pp
113 If the
114 .Fl p
115 option is specified,
116 .Nm
117 will duplicate the quotas of the prototypical user
118 specified for each user specified.
119 This is the normal mechanism used to
120 initialize quotas for groups of users.
121 If the user given to assign quotas to is a numerical uid
122 range (e.g. 1000-2000), then
123 .Nm
124 will duplicate the quotas of the prototypical user
125 for each uid in the range specified.  This allows
126 for easy setup of default quotas for a group of users.
127 The uids in question do not have to be currently assigned in
128 .Pa /etc/passwd .
129 .Pp
130 If one or more
131 .Fl e Ar fspath Ns Op : Ns Ar bslim Ns Op : Ns Ar bhlim Ns Op : Ns Ar islim Ns Op : Ns Ar ihlim
132 options are specified,
133 .Nm
134 will non-interactively set quotas defined by
135 .Ar bslim ,
136 .Ar bhlim ,
137 .Ar islim and
138 .Ar ihlim
139 on each particular filesystem referenced by
140 .Ar fspath .
141 Here
142 .Ar bslim
143 is soft limit on number of blocks,
144 .Ar bslim
145 is hard limit on number of blocks,
146 .Ar islim
147 is soft limit on number of files and
148 .Ar ihlim
149 is hard limit on number of files.
150 If any of the
151 .Ar bslim ,
152 .Ar bhlim ,
153 .Ar islim and
154 .Ar ihlim
155 values are omitted, it is assumed to be zero, therefore
156 indicating that no quota should be imposed.
157 .Pp
158 If invoked with the
159 .Fl f
160 option,
161 .Nm
162 will read and modify quotas on the filesystem specified by
163 .Ar fspath
164 only.
165 The
166 .Ar fspath
167 argument may be either a special device
168 or a filesystem mount point.
169 The primary purpose of this option is to set the scope for the
170 .Fl p
171 option, which would overwrite quota records on every
172 filesystem with quotas otherwise.
173 .Pp
174 If the
175 .Fl g
176 flag is specified,
177 .Nm
178 is invoked to edit the quotas of
179 one or more groups specified on the command line.
180 The
181 .Fl p
182 flag can be specified in conjunction with
183 the
184 .Fl g
185 flag to specify a prototypical group
186 to be duplicated among the listed set of groups.
187 Similarly,
188 .Fl e
189 flag can be specified in conjunction with
190 the
191 .Fl g
192 flag to non-interactively set-up quotas on the listed set
193 of groups.
194 .Pp
195 Users are permitted to exceed their soft limits
196 for a grace period that may be specified per filesystem.
197 Once the grace period has expired,
198 the soft limit is enforced as a hard limit.
199 The default grace period for a filesystem is specified in
200 .Pa /usr/include/ufs/ufs/quota.h .
201 The
202 .Fl t
203 flag can be used to change the grace period.
204 By default, or when invoked with the
205 .Fl u
206 flag,
207 the grace period is set for all the filesystems with user
208 quotas specified in
209 .Pa /etc/fstab .
210 When invoked with the
211 .Fl g
212 flag the grace period is
213 set for all the filesystems with group quotas specified in
214 .Pa /etc/fstab .
215 The grace period may be specified in days, hours, minutes, or seconds.
216 Setting a grace period to zero indicates that the default
217 grace period should be imposed.
218 Setting a grace period to one second indicates that no
219 grace period should be granted.
220 .Pp
221 Only the super-user may edit quotas.
222 .Sh FILES
223 .Bl -tag -width quota.group -compact
224 .It Pa quota.user
225 at the filesystem root with user quotas
226 .It Pa quota.group
227 at the filesystem root with group quotas
228 .It Pa /etc/fstab
229 to find filesystem names and locations
230 .El
231 .Sh SEE ALSO
232 .Xr quota 1 ,
233 .Xr quotactl 2 ,
234 .Xr fstab 5 ,
235 .Xr quotacheck 8 ,
236 .Xr quotaon 8 ,
237 .Xr repquota 8
238 .Sh DIAGNOSTICS
239 Various messages about inaccessible files; self-explanatory.