xref: /freebsd/sbin/quotacheck/quotacheck.8 (revision 069ac184)
1.\" Copyright (c) 1983, 1990, 1991, 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 January 25, 2007
32.Dt QUOTACHECK 8
33.Os
34.Sh NAME
35.Nm quotacheck
36.Nd file system quota consistency checker
37.Sh SYNOPSIS
38.Nm
39.Op Fl guv
40.Op Fl c Ar 32 | 64
41.Op Fl l Ar maxrun
42.Fl a
43.Nm
44.Op Fl guv
45.Op Fl c Ar 32 | 64
46.Ar filesystem ...
47.Sh DESCRIPTION
48The
49.Nm
50utility examines each file system,
51builds a table of current disk usage,
52and compares this table against that recorded
53in the disk quota file for the file system.
54If any inconsistencies are detected, both the
55quota file and the current system copy of the
56incorrect quotas are updated (the latter only
57occurs if an active file system is checked).
58By default both user and group quotas are checked.
59.Pp
60The following options are available:
61.Bl -tag -width indent
62.It Fl a
63If supplied in place of any file system names,
64.Nm
65will check all the file systems indicated in
66.Pa /etc/fstab
67to be read-write with disk quotas.
68By default only the types of quotas listed in
69.Pa /etc/fstab
70are checked.
71.It Fl c Ar 32 | 64
72Before performing its checks,
73.Nm
74will convert the quota file to the specified word size.
75A conversion size of 64 is given to request conversion to
76the new 64-bit quota file format.
77A conversion size of 32 is given to request conversion back to
78the old 32-bit quota file format.
79The original quota file is left unchanged and moved aside with an
80underscore and its format size plus a
81.Pa .orig
82extension added to its name.
83Thus, the original 32-bit
84.Pa quota.user
85quota file converted to the 64-bit format quota file will be renamed to
86.Pa quota.user_32.orig .
87.It Fl g
88Only group quotas listed in
89.Pa /etc/fstab
90are to be checked.
91.It Fl l Ar maxrun
92Specifies the maximum number of concurrent file systems
93to check in parallel.
94If this option is omitted, or if
95.Ar maxrun
96is zero, parallel passes are run as per
97.Xr fsck 8 .
98This option is deprecated and parallel passes are always run
99as per
100.Xr fsck 8 .
101.It Fl u
102Only user quotas listed in
103.Pa /etc/fstab
104are to be checked.
105.It Fl v
106Report discrepancies between the
107calculated and recorded disk quotas and other additional diagnostic messages.
108.El
109.Pp
110Specifying both
111.Fl g
112and
113.Fl u
114is equivalent to the default.
115Parallel passes are run on the file systems required,
116using the pass numbers in
117.Pa /etc/fstab
118in an identical fashion to
119.Xr fsck 8 .
120.Pp
121Normally,
122.Nm
123operates silently.
124.Pp
125The
126.Nm
127utility expects each file system to be checked to have a
128quota files named
129.Pa quota.user
130and
131.Pa quota.group
132which are located at the root of the associated file system.
133These defaults may be overridden in
134.Pa /etc/fstab .
135If a file is not present,
136.Nm
137will create it.
138These files should be edited with the
139.Xr edquota 8
140utility.
141.Pp
142The
143.Nm
144utility is normally run at boot time from the
145.Pa /etc/rc
146file.
147The rc startup procedure is controlled by the
148.Pa /etc/rc.conf
149variable
150.Ar check_quotas .
151Note that to enable this functionality in
152.Pa /etc/rc
153you also need to enable startup quota procedures
154with the variable
155.Ar enable_quotas
156in
157.Pa /etc/rc.conf .
158The kernel must also be built with
159.Cd "options QUOTA" .
160.Pp
161The
162.Nm
163utility accesses the raw device in calculating the actual
164disk usage for each user.
165Thus, the file systems
166checked should be quiescent while
167.Nm
168is running.
169.Sh FILES
170.Bl -tag -width quota.group -compact
171.It Pa quota.user
172at the file system root with user quotas
173.It Pa quota.group
174at the file system root with group quotas
175.It Pa /etc/fstab
176default file systems
177.El
178.Sh SEE ALSO
179.Xr quota 1 ,
180.Xr quotactl 2 ,
181.Xr fstab 5 ,
182.Xr rc.conf 5 ,
183.Xr edquota 8 ,
184.Xr fsck 8 ,
185.Xr quotaon 8 ,
186.Xr repquota 8
187.Sh HISTORY
188The
189.Nm
190utility appeared in
191.Bx 4.2 .
192.Sh BUGS
193The quota system will ignore UIDs or GIDs that would be negative
194when evaluated as a signed value.
195Typically those types of ids can appear in the file system from NFS
196mounts or archive files from other operating systems.
197Extremely large UIDs or GIDs will cause
198.Nm
199to run for an unreasonable amount of time and also produce extremely
200large quota data files.
201