xref: /freebsd/sbin/quotacheck/quotacheck.8 (revision f0adf7f5cdd241db2f2c817683191a6ef64a4e95)
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 June 5, 1993
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 g
43.Op Fl u
44.Op Fl v
45.Ar filesystem
46.Ar
47.Nm
48.Op Fl g
49.Op Fl u
50.Op Fl v
51.Fl a
52.Sh DESCRIPTION
53The
54.Nm
55utility examines each file system,
56builds a table of current disk usage,
57and compares this table against that recorded
58in the disk quota file for the file system.
59If any inconsistencies are detected, both the
60quota file and the current system copy of the
61incorrect quotas are updated (the latter only
62occurs if an active file system is checked).
63By default both user and group quotas are checked.
64.Pp
65The following options are available:
66.Bl -tag -width indent
67.It Fl a
68If supplied in place of any file system names,
69.Nm
70will check all the file systems indicated in
71.Pa /etc/fstab
72to be read-write with disk quotas.
73By default only the types of quotas listed in
74.Pa /etc/fstab
75are checked.
76.It Fl g
77Only group quotas listed in
78.Pa /etc/fstab
79are to be checked.
80.It Fl u
81Only user quotas listed in
82.Pa /etc/fstab
83are to be checked.
84.It Fl v
85Report discrepancies between the
86calculated and recorded disk quotas and other additional diagnostic messages.
87.El
88.Pp
89Specifying both
90.Fl g
91and
92.Fl u
93is equivalent to the default.
94Parallel passes are run on the file systems required,
95using the pass numbers in
96.Pa /etc/fstab
97in an identical fashion to
98.Xr fsck 8 .
99.Pp
100Normally,
101.Nm
102operates silently.
103.Pp
104The
105.Nm
106utility expects each file system to be checked to have a
107quota files named
108.Pa quota.user
109and
110.Pa quota.group
111which are located at the root of the associated file system.
112These defaults may be overridden in
113.Pa /etc/fstab .
114If a file is not present,
115.Nm
116will create it.
117These files should be edited with the
118.Xr edquota 8
119utility.
120.Pp
121The
122.Nm
123utility is normally run at boot time from the
124.Pa /etc/rc
125file.
126The rc startup procedure is controlled by the
127.Pa /etc/rc.conf
128variable
129.Ar check_quotas .
130Note that to enable this functionality in
131.Pa /etc/rc
132you also need to enable startup quota procedures
133with the variable
134.Ar enable_quotas
135in
136.Pa /etc/rc.conf .
137.Pp
138The
139.Nm
140utility accesses the raw device in calculating the actual
141disk usage for each user.
142Thus, the file systems
143checked should be quiescent while
144.Nm
145is running.
146.Sh FILES
147.Bl -tag -width quota.group -compact
148.It Pa quota.user
149at the file system root with user quotas
150.It Pa quota.group
151at the file system root with group quotas
152.It Pa /etc/fstab
153default file systems
154.El
155.Sh SEE ALSO
156.Xr quota 1 ,
157.Xr quotactl 2 ,
158.Xr fstab 5 ,
159.Xr edquota 8 ,
160.Xr fsck 8 ,
161.Xr quotaon 8 ,
162.Xr repquota 8
163.Sh HISTORY
164The
165.Nm
166utility appeared in
167.Bx 4.2 .
168