summaryrefslogtreecommitdiff
path: root/quotacheck.8
blob: 2a7489a0277c656bea9140f6a2faa3ee8064a831 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
.TH quotacheck 8 "Mon Jul 17 2000"
.SH NAME
quotacheck \- scan a file system for disk usages, create, check and repair quota files
.SH SYNOPSIS
.B quotacheck
[
.B \-gucfinvdMmR
] [
.B \-F
.I quota-format
]
.B \-a
|
.I filesystem
.br
.SH DESCRIPTION
.B Quotacheck
first checks old quota files for given filesystem and reads user / group limits
from them (if it is creating new files -- see option
.B -c
-- this step is ommited, of course). Then performs a filesystem scan for usage
of files and directories, used by either user or group. The output are new quota
files for the corresponding filesystem. The names of these files are:
.br
\-  A user scan: 
.B aquota.user
or
.B quota.user
(depending on quota format)
.br
\-  A group scan:
.B aquota.group
or
.B quota.group
.PP
Old files are stored as
.B aquota.user~
/
.B quota.user~
and
.B aquota.group~
/
.BR quota.group~ .
.PP
Old quota format (version 1) has no way of detecting quotafile corruption and so
following text is meaningful only for version 2 quota format. When quota file is corrupted,
.B quotacheck
tries to save as many data as possible (which can sometimes result in bogus entries
being created). Rescuing data might need user intervention. With no special options
.B quotacheck
will simply exit in that situation. When in interactive mode (option
.BR -i )
user is asked for an advice. Advices can be also provided from command line (see option
.BR -n )
which is handful when
.B quotacheck
is run automatically (ie. from script) and you can't
afford
.B quotacheck
to fail.
.PP
.B Quotacheck
should be run each time the system boots and mounts non-valid file systems.
This is most likely to happen after a system crash.
.PP
It is strongly recommended to run
.B quotacheck
with quotas turned off on concerned file system. Otherwise you can loose or damage some
data in quota files. Also it is wise not to run
.B quotacheck
on live filesystem as directory scan might count bogus usage in that case. To prevent this
.B quotacheck
tries to remount filesystem read-only before starting the scan of filesystem and after
the scan is done it remounts filesystem read-write. You can turn off this feature by
option
.BR \-m .
You can also make
.B quotacheck
ignore that it didn't succeed when remounting filesystem read-only by option
.BR \-M .
.PP
The speed of the scan decrease with the amount of directories increasing.
The time needed doubles when disk usage is doubled as well.
.SH OPTIONS
.TP
.B \-v
This way the program will give some usefull information about what it is
doing, plus some fancy stuff.
.TP
.B \-d
This means debug. It will result in a lot of information which can be used
in debugging the program. The output is very verbose and the scan
will not be fast.
.TP
.B \-u
This flag tells the program to scan the disk and to count the files and
directories used by a certain uid. This is the default action.
.TP
.B \-g
This flag forces the program to count the the files and directories
used by a certain gid.
.TP
.B \-c
Don't read old quota files. Just perform directory scan and dump usage.
.TP
.B \-f
This flags forces checking of filesystem with quotas enabled. Note that doing
this is not recomended as created quota files might be damaged or out of date.
.TP
.B \-M
This flag forces checking of filesystem in read-write mode if remount fails. Do this only when
you are sure no process will write to a filesystem while scanning.
.TP
.B \-m
Don't try to remount filesystem read-only. See comment at option
.BR \-M .
.TP
.B \-i
Interactive mode. By default
.B quotacheck
exits when it finds some error. In interactive mode user is asked for an advice instead.
See also option
.BR \-n .
.TP
.B \-n
Sometimes it may happen that more entries for the same id are found. Normally
.B quotacheck
exits or asks user. When this option is set first entry found is always used (this option
works in interactive mode too).
.TP
.B \-F \f2format-name\f1
Check quota quota for specified format (ie. don't perform format autodetection). This is
recommended as detection might not work well on corrupted quotafiles.
Possible format names are:
.B vfsold
(version 1 quota),
.B vfsv0
(version 2 quota),
.B rpc
(quota over NFS),
.B xfs
(quota on XFS filesystem)
.TP
.B \-a
Check all filesystems in
.B /etc/mtab
.TP
.B \-R
When used together with
.B \-a
option, all filesystems except root filesystem are checked for quotas.
.SH NOTE
.B Quotacheck
should only be run by super-user. Non-priviledged users are presumably not allowed
to read all the directories on the given filesystem.
.SH "SEE ALSO"
.BR quota (1),
.BR quotactl (2),
.BR fstab (5),
.BR quotaon (8),
.BR repquota (8),
.BR convertquota (8),
.BR setquota (8),
.BR edquota (8),
.BR fsck (8),
.BR efsck (8),
.BR e2fsck (8),
.BR xfsck (8)
.SH FILES
.PD 0
.TP 15
.B aquota.user or aquota.group
located at filesystem root with user quotas (version 2 quota, non-XFS filesystems)
.TP 15
.B quota.user or quota.group
located at filesystem root with user quotas (version 1 quota, non-XFS filesystems)
.TP
.B /etc/mtab
names and locations of mounted filesystems
.SH AUTHOR
Jan Kara \<jack@suse.cz\>
.br
Based on old
.B quotacheck
by:
.br
Edvard Tuinder \<ed@elm.net\>
.br
Marco van Wieringen \<mvw@planets.elm.net\>