1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
|
.TH QUOTATOOL 8 "1999 - 2024" "version 1.6.5"
.SH NAME
quotatool \- manipulate filesystem quotas
.SH SYNOPSIS
.B quotatool
[-u [:]uid | -g [:]gid] [-b | -i] [-r | -l NUM | -q NUM] [-nvR] [-d]
.I filesystem
.br
.B quotatool
(-u | -g) (-b | -i) -t TIME [-nv]
.I filesystem
.br
.B quotatool
[-hV]
.br
.SH DESCRIPTION
.B quotatool
is a tool for manipulating filesystem quotas. Depending on the
commandline options given, it can set hard or soft limits on block and
inode usage, set and reset grace periods, for both users and (if your
system supports this) groups. The filesystem to set the quota on is
given as the first (and only) non-option element, and it is either the
block special file (i.e /dev/sda3) or the mount point (i.e. /home) for
the filesystem.
.SH OPTIONS
.TP
-u [[:]uid]
Set user quotas
.TP
-g [[:]gid]
Set group quotas
.LP
.IR uid
and
.IR gid
are either the numerical ID of the user or group, or its
name in the
.B /etc/passwd
and
.B /etc/group
files. Prefix
.IR :
allows using numerical uid/gid not present in /etc/passwd or /etc/group.
.TP
-b
Set block quotas [default]
.TP
-i
Set inode quotas
.LP
The -b and -i options are persistent -- they stay in effect until
they are overridden.
.TP
-R
Only raise quotas, never lower. Makes sure you don't accidentally lower quotas for a user/group.
.TP
-t TIME
Set the system-wide grace period to TIME. TIME consists
of an optional '-' or '+' character, a number, and optionally
one of the following modifiers: "seconds", "minutes", "hours",
"days", "weeks", or "months". Unique abbreviations (e.g. "s",
"mo") are also accepted. The default is "seconds".
The argument should be preceded by -u|-g and -b|-i
.TP
-r
Reset the grace period
.TP
-l NUM
Set hard limit to NUM
.TP
-q NUM
Set soft limit (quota) to NUM
.LP
NUM consists of an optional '-' or '+' character, a number (integer or floating point),
and optionally one of the following modifiers:
"Kb", "Mb", "Gb", "Tb", "bytes", or "blocks". Unique abbreviations
are also accepted. The default is "blocks". Modifiers are base 2 for block quotas (1k = 1024), and base 10 for inode quotas (1k = 1000)
.PP
If +/- is supplied, the existing quota is
increased or reduced by the specified amount.
.TP
.I -d
Dump quota info for user/group in a machine readable format:
.IP
|------- BLOCKS --------| |-------- FILES --------|
.br
.B uid/gid mountpoint current quota limit grace current quota limit grace
.IP
.B grace
is the number of seconds from now until the grace time ends. May be
negative = time already passed. When quota is not passed, grace is zero.
.TP
-n
dry-run: show what would have been done but don't change anything.
Use together with -v
.TP
-v
Verbose output. Use twice or thrice for even more output (debugging)
.TP
.I -h
Print a usage message to stdout and exit successfully
.TP
.I -V
Print version information to stdout and exit successfully
.SH FILESYSTEMS / FORMATS
On Linux,
.B quotatool
works with both "old", "vfsv0" and "vfsv1" + "generic" kernel-quota formats.
Supported filesystems: ext2, ext3, ext4, ReiserFS and XFS.
Mac OS X: hfs
FreeBSD / OpenBSD / NetBSD: filesystems ufs and ffs
.SH EXAMPLES
Set soft block limit to 800Mb, hard block limit to 1.2 Gb for user mpg4 on /home:
quotatool -u mpg4 -b -q 800M -l 1.2G /home
Raise soft block limit by 100M for non-existent gid 12345 on /dev/loop3:
quotatool -g :12345 -b -q +100M /dev/loop3
Set soft inode limit to 1.8k (1800), hard inode limit to 2000 for user johan on /var:
quotatool -u johan -i -q 1.8K -l 2000 /var
Set the global block grace period to one week on /home:
quotatool -u -b -t "1 week" /home
Restart inode grace period for user johan on root filesystem:
quotatool -u johan -i -r /
.SH NOTES
Grace periods are set on a "global per quotatype and filesystem" basis only.
Each quotatype (usrquota / grpquota) on each filesystem has two grace periods
- one for block limits and one for inode limits.
It is not possible to set different grace periods for users on the same filesystem.
According to 'man quotactl', global grace periods should be supported on BSD. quotatool on
BSD does the right thing, which can be confirmed with 'edquota -t'. However, the value
doesn't seem to be used by the system when usage passes a soft limit.
So far, I haven't been able to make global grace periods work on Mac OS X, either with 'edquota -t' or quotatool.
Using non-existent uids/gids like ":12345" can be useful when configuring quotas on
a mounted filesystem which is a separate system in it self, like when preparing an
install image or repairing a filesystem from another installation.
Limit arguments can be specified in several ways, these are all equivalent:
1M
1m
1Mb
1 "Mb"
Use +/- to raise/lower quotas relative to current limits
Use -v (or -v -v) to see verbose/debug info when running commands
.SH FILES
.B quota.user
,
.B quota.group
(linux, *BSD, aix)
.br
.B .quota.user
,
.B .quota.group
(Mac OS X)
.br
.B quotas
(solaris, ...)
.SH BUGS
Please check https://github.com/ekenberg/quotatool for any open issues. Feel free to add a new issue if you find an unresolved bug!
.PP
Calling
.B quotatool
with more than one -v option will cause a segfault on some systems.
This will happen if vprintf (3) fails to check for NULL arguments.
GNU libc doesn't have this problem, solaris libc does.
.SH SEE ALSO
.BR quota (1),
.BR quotactl (2),
.BR edquota (8),
.BR quotacheck (8),
.BR quotaon (8),
.BR repquota (8)
|