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