Update to 4.01.
[profile/ivi/quota.git] / quotacheck.8
1 .TH quotacheck 8 "Fri Jul 20 2001"
2 .SH NAME
3 quotacheck \- scan a filesystem for disk usage, create, check and repair quota files
4 .SH SYNOPSIS
5 .B quotacheck
6 [
7 .B \-gubcfinvdMmR
8 ] [
9 .B \-F
10 .I quota-format
11 ]
12 .B \-a
13 |
14 .I filesystem
15 .br
16 .SH DESCRIPTION
17 .B quotacheck
18 examines each filesystem, builds a table of current disk usage, and
19 compares this table against that recorded in the disk quota file for the
20 filesystem (this step is omitted if option
21 .B -c
22 is specified). If any inconsistencies are detected, both the quota file
23 and the current system copy of the incorrect quotas are updated (the
24 latter only occurs if an active filesystem is checked which is not advised).
25 By default, only user quotas are checked.
26 .B quotacheck
27 expects each filesystem to be checked to have quota files named
28 .I [a]quota.user
29 and
30 .I [a]quota.group
31 located at the root of the associated filesystem.  If a file is not
32 present, 
33 .B quotacheck
34 will create it.
35 .PP
36 If the quota file is corrupted,
37 .B quotacheck
38 tries to save as much data as possible.  Rescuing data may need user
39 intervention. With no additional options
40 .B quotacheck
41 will simply exit in such a situation. When in interactive mode (option
42 .BR -i )
43 , the user is asked for advice. Advice can also be provided from command
44 line (see option
45 .BR -n )
46 , which is useful when
47 .B quotacheck
48 is run automatically (ie. from script) and failure is unacceptable.
49 .PP
50 .B quotacheck
51 should be run each time the system boots and mounts non-valid filesystems.
52 This is most likely to happen after a system crash.
53 .PP
54 It is strongly recommended to run
55 .B quotacheck
56 with quotas turned off for the filesystem. Otherwise, possible damage
57 or loss to data in the quota files can result.  It is also unwise to
58 run
59 .B quotacheck
60 on a live filesystem as actual usage may change during the scan.  To
61 prevent this,
62 .B quotacheck
63 tries to remount the filesystem read-only before starting the scan.  
64 After the scan is done it remounts the filesystem read-write. You can
65 disable this with option
66 .BR \-m .
67 You can also make
68 .B quotacheck
69 ignore the failure to remount the filesystem read-only with option
70 .BR \-M .
71 .SH OPTIONS
72 .TP
73 .B -b, --backup
74 Forces
75 .B quotacheck
76 to make backups of the quota file before writing the new data.
77 .TP
78 .B -v, --verbose
79 .B quotacheck
80 reports its operation as it progresses.  Normally it operates silently.
81 If the option is specified twice, also the current directory is printed (note
82 that printing can slow down the scan measurably).
83 .TP
84 .B -d, --debug
85 Enable debugging mode.  It will result in a lot of information which can
86 be used in debugging the program. The output is very verbose and the
87 scan will be slow.
88 .TP
89 .B -u, --user
90 Only user quotas listed in
91 .I /etc/mtab
92 or on the filesystems specified are to be checked.  This is the default action.
93 .TP
94 .B -g, --group
95 Only group quotas listed in
96 .I /etc/mtab
97 or on the filesystems specified are to be checked.
98 .TP
99 .B -c, --create-files
100 Don't read existing quota files. Just perform a new scan and save it to disk.
101 .B quotacheck
102 also skips scanning of old quota files when they are not found.
103 .TP
104 .B -f, --force
105 Forces checking and writing of new quota files on filesystems with quotas
106 enabled. This is not recommended as the created quota files may be out of sync.
107 .TP
108 .B -M, --try-remount
109 This flag forces checking of filesystem in read-write mode if a remount
110 fails. Do this only when you are sure no process will write to a
111 filesystem while scanning.
112 .TP
113 .B -m, --no-remount
114 Don't try to remount filesystem read-only. See comment with option
115 .BR \-M .
116 .TP
117 .B -i, --interactive
118 Interactive mode. By default
119 .B quotacheck
120 exits when it finds an error. In interactive mode user is asked for
121 input instead.  See option
122 .BR \-n .
123 .TP
124 .B -n, --use-first-dquot
125 If the quota files become corrupted, it is possible for duplicate
126 entries for a single user or group ID to exist.  Normally in this case,
127 .B quotacheck
128 exits or asks user for input. When this option is set, the first entry found
129 is always used (this option works in interactive mode too).
130 .TP
131 .B -F, --format=\f2format-name\f1
132 Check and fix quota files of specified format (ie. don't perform format
133 auto-detection). This is recommended as detection might not work well on
134 corrupted quota files.  Possible format names are:
135 .B vfsold
136 Original quota format with 16-bit UIDs / GIDs,
137 .B vfsv0
138 Quota format with 32-bit UIDs / GIDs, 64-bit space usage, 32-bit inode usage and limits,
139 .B vfsv1
140 Quota format with 64-bit quota limits and usage,
141 .B rpc
142 (quota over NFS),
143 .B xfs
144 (quota on XFS filesystem)
145 .TP
146 .B -a, --all
147 Check all mounted non-NFS filesystems in
148 .B /etc/mtab
149 .TP
150 .B -R, --exclude-root
151 When used together with the
152 .B \-a
153 option, all filesystems except for the root filesystem are checked for
154 quotas.
155
156 .SH NOTE
157 .B quotacheck
158 should only be run by super-user. Non-privileged users are presumably
159 not allowed to read all the directories on the given filesystem.
160
161 .SH "SEE ALSO"
162 .BR quota (1),
163 .BR quotactl (2),
164 .BR fstab (5),
165 .BR quotaon (8),
166 .BR repquota (8),
167 .BR convertquota (8),
168 .BR setquota (8),
169 .BR edquota (8),
170 .BR fsck (8),
171 .BR efsck (8),
172 .BR e2fsck (8),
173 .BR xfsck (8)
174
175 .SH FILES
176 .PD 0
177 .TP 15
178 .B aquota.user or aquota.group
179 located at filesystem root with quotas (version 2 quota, non-XFS
180 filesystems)
181 .TP 15
182 .B quota.user or quota.group
183 located at filesystem root with quotas (version 1 quota, non-XFS
184 filesystems)
185 .TP
186 .B /etc/mtab
187 names and locations of mounted filesystems
188 .SH AUTHOR
189 Jan Kara \<jack@suse.cz\>
190 .br
191 Based on old
192 .B quotacheck
193 by:
194 .br
195 Edvard Tuinder \<ed@elm.net\>
196 .br
197 Marco van Wieringen \<mvw@planets.elm.net\>