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