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