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