Initial import from FreeBSD RELENG_4:
[dragonfly.git] / sbin / quotacheck / quotacheck.8
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. All advertising materials mentioning features or use of this software
16 .\"    must display the following acknowledgement:
17 .\"     This product includes software developed by the University of
18 .\"     California, Berkeley and its contributors.
19 .\" 4. Neither the name of the University nor the names of its contributors
20 .\"    may be used to endorse or promote products derived from this software
21 .\"    without specific prior written permission.
22 .\"
23 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 .\" SUCH DAMAGE.
34 .\"
35 .\"     @(#)quotacheck.8        8.1 (Berkeley) 6/5/93
36 .\" $FreeBSD: src/sbin/quotacheck/quotacheck.8,v 1.6.2.5 2003/02/24 00:56:42 trhodes Exp $
37 .\"
38 .Dd June 5, 1993
39 .Dt QUOTACHECK 8
40 .Os
41 .Sh NAME
42 .Nm quotacheck
43 .Nd file system quota consistency checker
44 .Sh SYNOPSIS
45 .Nm
46 .Op Fl g
47 .Op Fl u
48 .Op Fl v
49 .Ar filesystem
50 .Ar
51 .Nm
52 .Op Fl g
53 .Op Fl u
54 .Op Fl v
55 .Fl a
56 .Sh DESCRIPTION
57 The
58 .Nm
59 utility examines each file system,
60 builds a table of current disk usage,
61 and compares this table against that recorded
62 in the disk quota file for the file system.
63 If any inconsistencies are detected, both the
64 quota file and the current system copy of the
65 incorrect quotas are updated (the latter only
66 occurs if an active file system is checked).
67 By default both user and group quotas are checked.
68 .Pp
69 The following options are available:
70 .Bl -tag -width indent
71 .It Fl a
72 If supplied in place of any file system names,
73 .Nm
74 will check all the file systems indicated in
75 .Pa /etc/fstab
76 to be read-write with disk quotas.
77 By default only the types of quotas listed in
78 .Pa /etc/fstab
79 are checked.
80 .It Fl g
81 Only group quotas listed in
82 .Pa /etc/fstab
83 are to be checked.
84 .It Fl u
85 Only user quotas listed in
86 .Pa /etc/fstab
87 are to be checked.
88 .It Fl v
89 Report discrepancies between the
90 calculated and recorded disk quotas and other additional diagnostic messages.
91 .El
92 .Pp
93 Specifying both
94 .Fl g
95 and
96 .Fl u
97 is equivalent to the default.
98 Parallel passes are run on the file systems required,
99 using the pass numbers in
100 .Pa /etc/fstab
101 in an identical fashion to
102 .Xr fsck 8 .
103 .Pp
104 Normally,
105 .Nm
106 operates silently.
107 .Pp
108 The
109 .Nm
110 utility expects each file system to be checked to have a
111 quota files named
112 .Pa quota.user
113 and
114 .Pa quota.group
115 which are located at the root of the associated file system.
116 These defaults may be overridden in
117 .Pa /etc/fstab .
118 If a file is not present,
119 .Nm
120 will create it.
121 These files should be edited with the
122 .Xr edquota 8
123 utility.
124 .Pp
125 The
126 .Nm
127 utility is normally run at boot time from the
128 .Pa /etc/rc
129 file.
130 The rc startup procedure is controlled by the
131 .Pa /etc/rc.conf
132 variable
133 .Ar check_quotas .
134 Note that to enable this functionality in
135 .Pa /etc/rc
136 you also need to enable startup quota procedures
137 with the variable
138 .Ar enable_quotas
139 in
140 .Pa /etc/rc.conf .
141 .Pp
142 The
143 .Nm
144 utility accesses the raw device in calculating the actual
145 disk usage for each user.
146 Thus, the file systems
147 checked should be quiescent while
148 .Nm
149 is running.
150 .Sh FILES
151 .Bl -tag -width quota.group -compact
152 .It Pa quota.user
153 at the file system root with user quotas
154 .It Pa quota.group
155 at the file system root with group quotas
156 .It Pa /etc/fstab
157 default file systems
158 .El
159 .Sh SEE ALSO
160 .Xr quota 1 ,
161 .Xr quotactl 2 ,
162 .Xr fstab 5 ,
163 .Xr edquota 8 ,
164 .Xr fsck 8 ,
165 .Xr quotaon 8 ,
166 .Xr repquota 8
167 .Sh HISTORY
168 The
169 .Nm
170 utility appeared in
171 .Bx 4.2 .