xref: /netbsd-src/usr.sbin/quotacheck/quotacheck.8 (revision 6a493d6bc668897c91594964a732d38505b70cbb)
1.\"	$NetBSD: quotacheck.8,v 1.18 2012/02/13 19:53:25 dholland Exp $
2.\"
3.\" Copyright (c) 1983, 1990, 1991, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" This code is derived from software contributed to Berkeley by
7.\" Robert Elz at The University of Melbourne.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\" 3. Neither the name of the University nor the names of its contributors
18.\"    may be used to endorse or promote products derived from this software
19.\"    without specific prior written permission.
20.\"
21.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31.\" SUCH DAMAGE.
32.\"
33.\"     @(#)quotacheck.8	8.1 (Berkeley) 6/5/93
34.\"
35.Dd January 5, 2004
36.Dt QUOTACHECK 8
37.Os
38.Sh NAME
39.Nm quotacheck
40.Nd filesystem quota consistency checker
41.Sh SYNOPSIS
42.Nm
43.Op Fl gquv
44.Ar filesystem Ar ...
45.Nm
46.Op Fl gquv
47.Op Fl l Ar maxparallel
48.Fl a
49.Sh DESCRIPTION
50.Nm
51examines each filesystem,
52builds a table of current disk usage,
53and compares this table against that recorded
54in the disk quota file for the filesystem.
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 filesystem is checked).
59By default both user and group quotas are checked.
60.Pp
61Available options:
62.Bl -tag -width Ds
63.It Fl a
64If the
65.Fl a
66flag is supplied in place of any filesystem names,
67.Nm
68will check all the filesystems indicated in
69.Pa /etc/fstab
70to be read-write with disk quotas.
71By default only the types of quotas listed in
72.Pa /etc/fstab
73are checked.
74See also
75.Fl l .
76.It Fl g
77Only group quotas listed in
78.Pa /etc/fstab
79are to be checked.
80See also
81.Fl u .
82.It Fl l Ar maxparallel
83Limit the number of parallel checks to the number specified in
84the following argument.
85By default, the limit is the number of disks, running one process
86per disk.
87If a smaller limit is given, the disks are checked round-robin,
88one file system at a time.
89This option is only valid with
90.Fl a .
91.It Fl q
92.Nm
93runs more quickly,
94particularly on systems with sparse user id usage,
95but fails to correct quotas for users [groups]
96not in the system user [group] database,
97and owning no files on the filesystem,
98if the quota file incorrectly believes that they do.
99.It Fl u
100Only user quotas listed in
101.Pa /etc/fstab
102are to be checked.
103See also
104.Fl g .
105.It Fl v
106.Nm
107is more verbose,
108and reports corrected discrepancies between the
109calculated and recorded disk quotas.
110.El
111.Pp
112Specifying both
113.Fl g
114and
115.Fl u
116is equivalent to the default.
117Parallel passes are run on the filesystems 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
127.Nm
128expects each filesystem to be checked to have a
129quota files named
130.Pa quota.user
131and
132.Pa quota.group
133which are located at the root of the associated file system.
134These defaults may be overridden in
135.Pa /etc/fstab .
136If a file is not present,
137.Nm
138will create it.
139.Pp
140.Nm
141is normally run at boot time from the
142.Pa /etc/rc
143file, see
144.Xr rc 8 ,
145before enabling disk quotas with
146.Xr quotaon 8 .
147.Pp
148.Nm
149accesses the raw device in calculating the actual
150disk usage for each user.
151Thus, the filesystems
152checked should be quiescent while
153.Nm
154is running.
155.Pp
156If
157.Nm
158receives a
159.Dv SIGINFO
160signal
161(see the
162.Sy status
163argument for
164.Xr stty 1 ) ,
165a line will be written to the standard error output indicating
166the name of the device currently being checked and progress information.
167.Sh FILES
168.Bl -tag -width quota.group -compact
169.It Pa quota.user
170at the filesystem root with user quotas
171.It Pa quota.group
172at the filesystem root with group quotas
173.It Pa /etc/fstab
174default filesystems
175.El
176.Sh SEE ALSO
177.Xr quota 1 ,
178.Xr libquota 3 ,
179.Xr fstab 5 ,
180.Xr edquota 8 ,
181.Xr fsck 8 ,
182.Xr quotaon 8 ,
183.Xr repquota 8
184.Sh HISTORY
185The
186.Nm
187command appeared in
188.Bx 4.2 .
189