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