diff options
author | jkar8572 <jkar8572> | 2001-08-07 12:10:59 +0000 |
---|---|---|
committer | jkar8572 <jkar8572> | 2001-08-07 12:10:59 +0000 |
commit | 5f7affb337573a9679d9a5205a697003f9b51979 (patch) | |
tree | ba9891ee2826a9b41323e4b43e6495e22b1bdf5a | |
parent | 566c2b5d75a399269596d925d9c4c8050a4fe055 (diff) | |
download | linuxquota-5f7affb337573a9679d9a5205a697003f9b51979.tar.gz |
Merged corrections to doc, one bugfix to quotacheck.
-rw-r--r-- | quotacheck.8 | 159 | ||||
-rw-r--r-- | quotacheck.c | 5 |
2 files changed, 81 insertions, 83 deletions
diff --git a/quotacheck.8 b/quotacheck.8 index 2a7489a..7c5f5b2 100644 --- a/quotacheck.8 +++ b/quotacheck.8 @@ -1,6 +1,6 @@ -.TH quotacheck 8 "Mon Jul 17 2000" +.TH quotacheck 8 "Fri Jul 20 2001" .SH NAME -quotacheck \- scan a file system for disk usages, create, check and repair quota files +quotacheck \- scan a filesystem for disk usage, create, check and repair quota files .SH SYNOPSIS .B quotacheck [ @@ -14,124 +14,115 @@ quotacheck \- scan a file system for disk usages, create, check and repair quota .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 quotacheck +examines each filesystem, builds a table of current disk usage, and +compares this table against that recorded in the disk quota file for the +filesystem (this step is ommitted if 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~ +is specified). If any inconsistencies are detected, both the quota file +and the current system copy of the incorrect quotas are updated (the +latter only occurs if an active filesystem is checked). By default, +only user quotas are checked. +.B quotacheck +expects each filesystem to be checked to have quota files named +.I [a]quota.user and -.B aquota.group~ -/ -.BR quota.group~ . +.I [a]quota.group +located at the root of the associated filesystem. If a file is not +present, +.B quotacheck +will create it. .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, +If the 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 +tries to save as much data as possible. Rescuing data may need user +intervention. With no additional options .B quotacheck -will simply exit in that situation. When in interactive mode (option +will simply exit in such a situation. When in interactive mode (option .BR -i ) -user is asked for an advice. Advices can be also provided from command line (see option +, the user is asked for advice. Advice can also be provided from command +line (see option .BR -n ) -which is handful when +, which is useful when .B quotacheck -is run automatically (ie. from script) and you can't -afford -.B quotacheck -to fail. +is run automatically (ie. from script) and failure is unacceptable. .PP -.B Quotacheck -should be run each time the system boots and mounts non-valid file systems. +.B quotacheck +should be run each time the system boots and mounts non-valid filesystems. 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 +with quotas turned off on for the filesystem. Otherwise, possible damage +or loss to data in the quota files can result. It is also unwise to +run .B quotacheck -on live filesystem as directory scan might count bogus usage in that case. To prevent this +on a live filesystem as actual usage may change during the scan. 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 +tries to remount the filesystem read-only before starting the scan. +After the scan is done it remounts the filesystem read-write. You can +disable this with option .BR \-m . You can also make .B quotacheck -ignore that it didn't succeed when remounting filesystem read-only by option +ignore the failure to remount the filesystem read-only with 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. +.B quotacheck +reports its operation as it progresses. Normally it operates silently. .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. +Enable debugging mode. 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 be slow. .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. +Only user quotas listed in +.I /etc/mtab +or on the filesystems specified are to be checked. 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. +Only group quotas listed in +.I /etc/mtab +or on the filesystems specified are to be checked. .TP .B \-c -Don't read old quota files. Just perform directory scan and dump usage. +Don't read existing quota files. Just perform a new scan and save it to disk. .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. +Forces checking of filesystems with quotas enabled. This is not +recommended as the created quota files may be out of sync. .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. +This flag forces checking of filesystem in read-write mode if a 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 +Don't try to remount filesystem read-only. See comment with 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 +exits when it finds an error. In interactive mode user is asked for +input instead. See option .BR \-n . .TP .B \-n -Sometimes it may happen that more entries for the same id are found. Normally +If the quota files become corrupted, it is possible for duplicate +entries for a single user or group ID to exist. Normally in this case, .B quotacheck -exits or asks user. When this option is set first entry found is always used (this option -works in interactive mode too). +exits or asks user for input. When this option is set, the 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: +Check quota quota for specified format (ie. don't perform format +auto-detection). This is recommended as detection might not work well on +corrupted quota files. Possible format names are: .B vfsold (version 1 quota), .B vfsv0 @@ -142,17 +133,20 @@ Possible format names are: (quota on XFS filesystem) .TP .B \-a -Check all filesystems in +Check all mounted non-NFS filesystems in .B /etc/mtab .TP .B \-R -When used together with +When used together with the .B \-a -option, all filesystems except root filesystem are checked for quotas. +option, all filesystems except for the 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. +.B quotacheck +should only be run by super-user. Non-privileged users are presumably +not allowed to read all the directories on the given filesystem. + .SH "SEE ALSO" .BR quota (1), .BR quotactl (2), @@ -166,14 +160,17 @@ to read all the directories on the given filesystem. .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) +located at filesystem root with 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) +located at filesystem root with quotas (version 1 quota, non-XFS +filesystems) .TP .B /etc/mtab names and locations of mounted filesystems diff --git a/quotacheck.c b/quotacheck.c index ea4487c..7ec2dac 100644 --- a/quotacheck.c +++ b/quotacheck.c @@ -8,7 +8,7 @@ * New quota format implementation - Jan Kara <jack@suse.cz> - Sponsored by SuSE CR */ -#ident "$Id: quotacheck.c,v 1.13 2001/07/16 03:24:49 jkar8572 Exp $" +#ident "$Id: quotacheck.c,v 1.14 2001/08/07 12:10:59 jkar8572 Exp $" #include <dirent.h> #include <stdio.h> @@ -832,7 +832,8 @@ static void check_all(void) mnt_fslabel = devlist[gotmnt - 1]; if ((flags & FL_ALL && (!(flags & FL_NOROOT) || strcmp(mnt->mnt_dir, "/"))) || (mntpoint && (devcmp(mntpoint, devlist[gotmnt - 1]) || dircmp(mntpoint, mnt->mnt_dir)))) { - if (!strcmp(mnt->mnt_type, MNTTYPE_XFS)) { + if (!strcmp(mnt->mnt_type, MNTTYPE_XFS) || + !strcmp(mnt->mnt_type, MNTTYPE_NFS)) { debug(FL_DEBUG | FL_VERBOSE, _("Skipping %s [%s]\n"), mnt_fslabel, mnt->mnt_dir); continue; |