xref: /freebsd/usr.sbin/edquota/edquota.8 (revision 8a7b61203704d362cfbc66c00619f51b24106b55)
1dea673e9SRodney W. Grimes.\" Copyright (c) 1983, 1990, 1993
2dea673e9SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
3dea673e9SRodney W. Grimes.\"
4dea673e9SRodney W. Grimes.\" This code is derived from software contributed to Berkeley by
5dea673e9SRodney W. Grimes.\" Robert Elz at The University of Melbourne.
6dea673e9SRodney W. Grimes.\"
7dea673e9SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
8dea673e9SRodney W. Grimes.\" modification, are permitted provided that the following conditions
9dea673e9SRodney W. Grimes.\" are met:
10dea673e9SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
11dea673e9SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
12dea673e9SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
13dea673e9SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
14dea673e9SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
15*fbbd9655SWarner Losh.\" 3. Neither the name of the University nor the names of its contributors
16dea673e9SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
17dea673e9SRodney W. Grimes.\"    without specific prior written permission.
18dea673e9SRodney W. Grimes.\"
19dea673e9SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20dea673e9SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21dea673e9SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22dea673e9SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23dea673e9SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24dea673e9SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25dea673e9SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26dea673e9SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27dea673e9SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28dea673e9SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29dea673e9SRodney W. Grimes.\" SUCH DAMAGE.
30dea673e9SRodney W. Grimes.\"
31681e5e7aSSteve Price.Dd June 6, 1993
32389766f3SMike Pritchard.Dt EDQUOTA 8
33389766f3SMike Pritchard.Os
34389766f3SMike Pritchard.Sh NAME
35389766f3SMike Pritchard.Nm edquota
36389766f3SMike Pritchard.Nd edit user quotas
37389766f3SMike Pritchard.Sh SYNOPSIS
38e97407b4SRuslan Ermilov.Nm
39b83b5d3bSKirk McKusick.Op Fl uh
40bc9c1e90SYaroslav Tykhiy.Op Fl f Ar fspath
41389766f3SMike Pritchard.Op Fl p Ar proto-username
42389766f3SMike Pritchard.Ar username ...
43e97407b4SRuslan Ermilov.Nm
44b8b743d7SMaxim Sobolev.Op Fl u
45c041c1e0SRuslan Ermilov.Fl e
46c041c1e0SRuslan Ermilov.Sm off
47c041c1e0SRuslan Ermilov.Ar fspath Op : Ar bslim Op : Ar bhlim Op : Ar islim Op : Ar ihlim
48c041c1e0SRuslan Ermilov.Sm on
49b8b743d7SMaxim Sobolev.Op Fl e Ar ...
50b8b743d7SMaxim Sobolev.Ar username ...
51b8b743d7SMaxim Sobolev.Nm
52389766f3SMike Pritchard.Fl g
53b83b5d3bSKirk McKusick.Op Fl h
54bc9c1e90SYaroslav Tykhiy.Op Fl f Ar fspath
55389766f3SMike Pritchard.Op Fl p Ar proto-groupname
56389766f3SMike Pritchard.Ar groupname ...
57e97407b4SRuslan Ermilov.Nm
58b8b743d7SMaxim Sobolev.Fl g
59c041c1e0SRuslan Ermilov.Fl e
60c041c1e0SRuslan Ermilov.Sm off
61c041c1e0SRuslan Ermilov.Ar fspath Op : Ar bslim Op : Ar bhlim Op : Ar islim Op : Ar ihlim
62c041c1e0SRuslan Ermilov.Sm on
63b8b743d7SMaxim Sobolev.Op Fl e Ar ...
64b8b743d7SMaxim Sobolev.Ar groupname ...
65b8b743d7SMaxim Sobolev.Nm
66389766f3SMike Pritchard.Fl t
67389766f3SMike Pritchard.Op Fl u
68bc9c1e90SYaroslav Tykhiy.Op Fl f Ar fspath
69e97407b4SRuslan Ermilov.Nm
70389766f3SMike Pritchard.Fl t
71389766f3SMike Pritchard.Fl g
72bc9c1e90SYaroslav Tykhiy.Op Fl f Ar fspath
73389766f3SMike Pritchard.Sh DESCRIPTION
74490d5836SPhilippe CharnierThe
75490d5836SPhilippe Charnier.Nm
76490d5836SPhilippe Charnierutility is a quota editor.
77389766f3SMike PritchardBy default, or if the
78389766f3SMike Pritchard.Fl u
79389766f3SMike Pritchardflag is specified,
80dea673e9SRodney W. Grimesone or more users may be specified on the command line.
81dea673e9SRodney W. GrimesFor each user a temporary file is created
82ea28e1c5SPhilippe Charnierwith an
83ea28e1c5SPhilippe Charnier.Tn ASCII
84ea28e1c5SPhilippe Charnierrepresentation of the current
85dea673e9SRodney W. Grimesdisk quotas for that user.
86dea673e9SRodney W. GrimesThe list of file systems with user quotas is determined from
87389766f3SMike Pritchard.Pa /etc/fstab .
88ea28e1c5SPhilippe CharnierAn editor is invoked on the
89ea28e1c5SPhilippe Charnier.Tn ASCII
90ea28e1c5SPhilippe Charnierfile.
91dea673e9SRodney W. GrimesThe editor invoked is
92389766f3SMike Pritchard.Xr vi 1
93389766f3SMike Pritchardunless the environment variable
94389766f3SMike Pritchard.Ev EDITOR
95389766f3SMike Pritchardspecifies otherwise.
96389766f3SMike Pritchard.Pp
97dea673e9SRodney W. GrimesThe quotas may then be modified, new quotas added, etc.
9808dc3a5eSKirk McKusickBlock quotas can be specified in bytes (B), kilobytes (K),
99b83b5d3bSKirk McKusickmegabytes (M), terabytes (T), petabytes (P), or exabytes (E).
10008dc3a5eSKirk McKusickIf no units are specified, kilobytes are assumed.
101b83b5d3bSKirk McKusickInode quotas can be specified in kiloinodes (K),
102b83b5d3bSKirk McKusickmegainodes (M), terainodes (T), petainodes (P), or exainodes (E).
103b83b5d3bSKirk McKusickIf no units are specified, the number of inodes specified are used.
10408dc3a5eSKirk McKusickIf the
10508dc3a5eSKirk McKusick.Fl h
10608dc3a5eSKirk McKusickflag is specified, the editor will always display the
10708dc3a5eSKirk McKusickblock usage and limits in a more human readable format
10808dc3a5eSKirk McKusickrather than displaying them in the historic kilobyte format.
109dea673e9SRodney W. GrimesSetting a quota to zero indicates that no quota should be imposed.
110dea673e9SRodney W. GrimesSetting a hard limit to one indicates that no allocations should
111dea673e9SRodney W. Grimesbe permitted.
112dea673e9SRodney W. GrimesSetting a soft limit to one with a hard limit of zero
113389766f3SMike Pritchardindicates that allocations should be permitted only on
114389766f3SMike Pritcharda temporary basis (see
115389766f3SMike Pritchard.Fl t
116389766f3SMike Pritchardbelow).
117dea673e9SRodney W. GrimesThe current usage information in the file is for informational purposes;
118dea673e9SRodney W. Grimesonly the hard and soft limits can be changed.
119389766f3SMike Pritchard.Pp
120dea673e9SRodney W. GrimesOn leaving the editor,
121389766f3SMike Pritchard.Nm
122dea673e9SRodney W. Grimesreads the temporary file and modifies the binary
123dea673e9SRodney W. Grimesquota files to reflect the changes made.
124389766f3SMike Pritchard.Pp
125dea673e9SRodney W. GrimesIf the
126389766f3SMike Pritchard.Fl p
127dea673e9SRodney W. Grimesoption is specified,
128389766f3SMike Pritchard.Nm
129dea673e9SRodney W. Grimeswill duplicate the quotas of the prototypical user
130dea673e9SRodney W. Grimesspecified for each user specified.
131dea673e9SRodney W. GrimesThis is the normal mechanism used to
132dea673e9SRodney W. Grimesinitialize quotas for groups of users.
133d172713dSMike PritchardIf the user given to assign quotas to is a numerical uid
13407bfccd7SRuslan Ermilovrange (e.g.\& 1000-2000), then
135389766f3SMike Pritchard.Nm
136d172713dSMike Pritchardwill duplicate the quotas of the prototypical user
13707bfccd7SRuslan Ermilovfor each uid in the range specified.
13807bfccd7SRuslan ErmilovThis allows
139d172713dSMike Pritchardfor easy setup of default quotas for a group of users.
140d172713dSMike PritchardThe uids in question do not have to be currently assigned in
141ea28e1c5SPhilippe Charnier.Pa /etc/passwd .
142389766f3SMike Pritchard.Pp
143b8b743d7SMaxim SobolevIf one or more
144c041c1e0SRuslan Ermilov.Fl e
145c041c1e0SRuslan Ermilov.Sm off
146c041c1e0SRuslan Ermilov.Ar fspath Op : Ar bslim Op : Ar bhlim Op : Ar islim Op : Ar ihlim
147c041c1e0SRuslan Ermilov.Sm on
148b8b743d7SMaxim Sobolevoptions are specified,
149b8b743d7SMaxim Sobolev.Nm
150b8b743d7SMaxim Sobolevwill non-interactively set quotas defined by
151da2f0082SYaroslav Tykhiy.Ar bslim , bhlim , islim ,
152c041c1e0SRuslan Ermilovand
153b8b743d7SMaxim Sobolev.Ar ihlim
154b8b743d7SMaxim Sobolevon each particular file system referenced by
155b8b743d7SMaxim Sobolev.Ar fspath .
156b8b743d7SMaxim SobolevHere
157b8b743d7SMaxim Sobolev.Ar bslim
158da2f0082SYaroslav Tykhiyis the soft limit on the number of blocks,
159b4950408SMaxim Konovalov.Ar bhlim
160da2f0082SYaroslav Tykhiyis the hard limit on the number of blocks,
161b8b743d7SMaxim Sobolev.Ar islim
162da2f0082SYaroslav Tykhiyis the soft limit on the number of files, and
163b8b743d7SMaxim Sobolev.Ar ihlim
164da2f0082SYaroslav Tykhiyis the hard limit on the number of files.
165b8b743d7SMaxim SobolevIf any of the
166da2f0082SYaroslav Tykhiy.Ar bslim , bhlim , islim ,
167c041c1e0SRuslan Ermilovand
168b8b743d7SMaxim Sobolev.Ar ihlim
169da2f0082SYaroslav Tykhiyvalues is omitted, it is assumed to be zero, therefore
170da2f0082SYaroslav Tykhiyindicating that no particular quota should be imposed.
17108dc3a5eSKirk McKusickBlock quotas can be specified in bytes (B), kilobytes (K),
172b83b5d3bSKirk McKusickmegabytes (M), terabytes (T), petabytes (P), or exabytes (E).
17308dc3a5eSKirk McKusickIf no units are specified, kilobytes are assumed.
174b83b5d3bSKirk McKusickInode quotas can be specified in kiloinodes (K),
175b83b5d3bSKirk McKusickmegainodes (M), terainodes (T), petainodes (P), or exainodes (E).
176b83b5d3bSKirk McKusickIf no units are specified, the number of inodes specified are used.
177b8b743d7SMaxim Sobolev.Pp
178bc9c1e90SYaroslav TykhiyIf invoked with the
179bc9c1e90SYaroslav Tykhiy.Fl f
180bc9c1e90SYaroslav Tykhiyoption,
181bc9c1e90SYaroslav Tykhiy.Nm
182bc9c1e90SYaroslav Tykhiywill read and modify quotas on the file system specified by
183bc9c1e90SYaroslav Tykhiy.Ar fspath
184bc9c1e90SYaroslav Tykhiyonly.
185bc9c1e90SYaroslav TykhiyThe
186bc9c1e90SYaroslav Tykhiy.Ar fspath
187bc9c1e90SYaroslav Tykhiyargument may be either a special device
188bc9c1e90SYaroslav Tykhiyor a file system mount point.
189bc9c1e90SYaroslav TykhiyThe primary purpose of this option is to set the scope for the
190bc9c1e90SYaroslav Tykhiy.Fl p
191bc9c1e90SYaroslav Tykhiyoption, which would overwrite quota records on every
192bc9c1e90SYaroslav Tykhiyfile system with quotas otherwise.
193bc9c1e90SYaroslav Tykhiy.Pp
194389766f3SMike PritchardIf the
195389766f3SMike Pritchard.Fl g
196389766f3SMike Pritchardflag is specified,
197389766f3SMike Pritchard.Nm
198dea673e9SRodney W. Grimesis invoked to edit the quotas of
199dea673e9SRodney W. Grimesone or more groups specified on the command line.
200389766f3SMike PritchardThe
201389766f3SMike Pritchard.Fl p
202389766f3SMike Pritchardflag can be specified in conjunction with
203389766f3SMike Pritchardthe
204389766f3SMike Pritchard.Fl g
205389766f3SMike Pritchardflag to specify a prototypical group
206dea673e9SRodney W. Grimesto be duplicated among the listed set of groups.
207b8b743d7SMaxim SobolevSimilarly,
208b8b743d7SMaxim Sobolev.Fl e
209b8b743d7SMaxim Sobolevflag can be specified in conjunction with
210b8b743d7SMaxim Sobolevthe
211b8b743d7SMaxim Sobolev.Fl g
212b8b743d7SMaxim Sobolevflag to non-interactively set-up quotas on the listed set
213b8b743d7SMaxim Sobolevof groups.
214389766f3SMike Pritchard.Pp
215dea673e9SRodney W. GrimesUsers are permitted to exceed their soft limits
216dea673e9SRodney W. Grimesfor a grace period that may be specified per file system.
217dea673e9SRodney W. GrimesOnce the grace period has expired,
218dea673e9SRodney W. Grimesthe soft limit is enforced as a hard limit.
219dea673e9SRodney W. GrimesThe default grace period for a file system is specified in
220743d5d51SRuslan Ermilov.In ufs/ufs/quota.h .
221389766f3SMike PritchardThe
222389766f3SMike Pritchard.Fl t
223389766f3SMike Pritchardflag can be used to change the grace period.
224389766f3SMike PritchardBy default, or when invoked with the
225389766f3SMike Pritchard.Fl u
226389766f3SMike Pritchardflag,
227dea673e9SRodney W. Grimesthe grace period is set for all the file systems with user
228dea673e9SRodney W. Grimesquotas specified in
229389766f3SMike Pritchard.Pa /etc/fstab .
230389766f3SMike PritchardWhen invoked with the
231389766f3SMike Pritchard.Fl g
232389766f3SMike Pritchardflag the grace period is
233dea673e9SRodney W. Grimesset for all the file systems with group quotas specified in
234389766f3SMike Pritchard.Pa /etc/fstab .
235dea673e9SRodney W. GrimesThe grace period may be specified in days, hours, minutes, or seconds.
236dea673e9SRodney W. GrimesSetting a grace period to zero indicates that the default
237dea673e9SRodney W. Grimesgrace period should be imposed.
238dea673e9SRodney W. GrimesSetting a grace period to one second indicates that no
239dea673e9SRodney W. Grimesgrace period should be granted.
240aecf742eSMike PritchardQuotas must be turned off for the file system and
241aecf742eSMike Pritchardthen turned back on for the new grace period to take effect.
242389766f3SMike Pritchard.Pp
243dea673e9SRodney W. GrimesOnly the super-user may edit quotas.
244389766f3SMike Pritchard.Sh FILES
245389766f3SMike Pritchard.Bl -tag -width quota.group -compact
246389766f3SMike Pritchard.It Pa quota.user
247389766f3SMike Pritchardat the file system root with user quotas
248389766f3SMike Pritchard.It Pa quota.group
249389766f3SMike Pritchardat the file system root with group quotas
250389766f3SMike Pritchard.It Pa /etc/fstab
251389766f3SMike Pritchardto find file system names and locations
252389766f3SMike Pritchard.El
25359a3c79dSRuslan Ermilov.Sh DIAGNOSTICS
25459a3c79dSRuslan ErmilovVarious messages about inaccessible files; self-explanatory.
255389766f3SMike Pritchard.Sh SEE ALSO
256389766f3SMike Pritchard.Xr quota 1 ,
257bfd34a4aSWolfram Schneider.Xr quotactl 2 ,
2588288fd54SChris Costello.Xr fstab 5 ,
259389766f3SMike Pritchard.Xr quotacheck 8 ,
260389766f3SMike Pritchard.Xr quotaon 8 ,
261389766f3SMike Pritchard.Xr repquota 8
262