Utility for checking and repairing quota files.
quotacheck [-gucbfinvdmMR] [-F
Utility for checking and repairing quota files.
quotacheck [-gucbfinvdmMR] [-F
quotacheck(8) quotacheck(8)
名前
quotacheck - ファイルシステムをスキャンしディスク使用量を調べる。quota
ファイルの作成・チェック・修復を行う
書式
quotacheck [ -gubcfinvdMmR ] [ -F quota-format ] -a | filesystem
説明
quotacheck は各ファイルシステムを調べて、現在のディスク使用量のテーブル
を構築し、ファイルシステムのディスク quota ファイルに記録されているテー
ブルと比較する (-c が指定された場合、最後のステップは省略される)。デ フ
ォルトではユーザー quota のみがチェックされる。 quotacheck はチェックさ
れる各ファイルシステムのルートに [a]quota.user と [a]quota.group という
名 前 の quota ファイルがあるものと仮定する。ファイルが存在しない場合、
quotacheck はこれを作成する。
quota ファイルが壊れている場合、 quotacheck は可能な限りデータを保存 し
よ うとする。データを救い出すにはユーザーの介入が必要かもしれない。この
ような状況でオプションを指定しないと、 quotacheck は単純に終了する。 対
話モード (オプション -i) では、ユーザーは意見 (advice) を尋ねられる。意
見をコマンドラインで提示することもできる (オプション -n を参照)。これは
quotacheck を自動的に (すなわち、スクリプトから) 実行し、失敗を受け入れ
ない場合に役に立つ。
quotacheck は、システムがブートして quota が正しく設定されていないフ ァ
イ ルシステムをマウントする度に必ず起動させなくてはならない。これはシス
テムクラッシュ後に最も良く起こりがちである。
ファイルシステムの quota を無効にして、 quotacheck を実行することを強く
推 奨する。さもないと、quota ファイルのデータが損傷したり失われたりする
可能性がある。スキャン中に実使用量が変わるかもしれないので、使用中の フ
ァ イルシステムに quotacheck を実行することも賢明でない。これを避けるた
め、 quotacheck はスキャンを開始する前にファイルシステムをリードオン リ
ー で再マウントしようとする。 quotacheck はスキャンが完了すると、ファイ
ルシステムをリードライトで再マウントする。オプション -m により、この 動
作 を無効にできる。オプション -M により、ファイルシステムをリードオンリ
ーで再マウントするときの失敗を quotacheck に無視させることもできる。
オプション
-b 新しいデータを書き込む前に、 quotacheck に quota ファイルのバ ッ
クアップを作成させる。
-v quotacheck に進行している操作を表示させる。通常は寡黙に動作する
。
-d デバッグモードを有効にする。プログラムのデバッグを行なうための多
くの情報を表示する。出力はかなり詳細になり、スキャン速度も低下す
るだろう。
-u /etc/mtab でリストされているファイルシステム、または指定されたフ
ァ イルシステムのユーザー quota のみがチェックされる。デフォルト
の動作である。
-g /etc/mtab でリストされているファイルシステム、または指定されたフ
ァイルシステムのグループ quota のみがチェックされる。
-c 既存の quota ファイルを読み込まない。新規にスキャンを実行し、そ
れをディスクに保存する。 quotacheck は古い quota ファイルが見 つ
からなければ、そのスキャンも飛ばす。
-f quota が有効にされているファイルシステムに対して、 quota ファイ
ルをチェックして、新しい quota ファイルを書き込む。
-M このフラグが指定されると、再マウントに失敗した場合にリードライト
モードでファイルシステムをチェックする。スキャン中にファイルシス
テムに書き込むプロセスがないことが確かな場合にのみ実行すべきであ
る。
-m フ ァイルシステムをリードオンリーで再マウントしない。オプション
-M のコメントも参照すること。
-i 対話モード。デフォルトでは、エラーがあった場合 quotacheck は終了
する。対話モードではユーザーは入力を求められる。オプション -n を
参照すること。
-n quota ファイルが壊れている場合でも、存在する 1 つのユーザ ー ID
またはグループ ID のエントリを複製できる可能性がある。通常はこの
ような場合、 quotacheck は終了するかユーザーに入力を求める。この
オプションが設定された場合、見つかった最初のエントリが常に使われ
る (このオプションは対話モードでも動作する)。
-F format-name
指定されたフォーマットの quota ファイルのチェックと修正を行う (
つまり、フォーマットの自動判定を行わない)。 quota ファイルが壊れ
ていて判定がうまく動作しない場合に推奨される。 vfsold (バージ ョ
ン 1 の quota), vfsv0 (バージョン 2 の quota), rpc (NFS 越しの
quota), xfs (XFS ファイルシステム上の quota)。
-a /etc/mtab にある NFS 以外の全てのファイルシステムをチェックす る
。
-R -a オプションとともに使った場合、ルートファイルシステム以外の全
てのファイルシステムがチェックされる。
注意
quotacheck はスーパーユーザーとしてのみ実行すべきである。恐らく非特権ユ
ー ザーは、指定されたファイルシステムの全てのディレクトリを読むことが許
可されていない。
関連項目
quota(1), quotactl(2), fstab(5), quotaon(8), repquota(8), con-
vertquota(8), setquota(8), edquota(8), fsck(8), efsck(8), e2fsck(8),
xfsck(8)
ファイル
aquota.user または aquota.group
quota を設定するファイルシステムのルートに置かれる (バー
ジョン 2 の quota, XFS 以外のファイルシステム)。
quota.user または quota.group
quota を設定するファイルシステムのルートに置かれる (バー
ジョン 1 の quota, XFS 以外のファイルシステム)。
/etc/mtab マウントされているファイルシステムの名前と位置が書かれて
いる。
著者
Jan Kara
quotacheck(8) quotacheck(8)
NAME
quotacheck - scan a filesystem for disk usage, create, check and repair
quota files
SYNOPSIS
quotacheck [ -gubcfinvdMmR ] [ -F quota-format ] -a | filesystem
DESCRIPTION
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 -c is speci-
fied). 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 which is not advised).
By default, only user quotas are checked. quotacheck expects each
filesystem to be checked to have quota files named [a]quota.user and
[a]quota.group located at the root of the associated filesystem. If a
file is not present, quotacheck will create it.
If the quota file is corrupted, quotacheck tries to save as much data
as possible. Rescuing data may need user intervention. With no addi-
tional options quotacheck will simply exit in such a situation. When in
interactive mode (option -i) , the user is asked for advice. Advice can
also be provided from command line (see option -n) , which is useful
when quotacheck is run automatically (ie. from script) and failure is
unacceptable.
quotacheck should be run each time the system boots and mounts non-
valid filesystems. This is most likely to happen after a system crash.
It is strongly recommended to run quotacheck with quotas turned off for
the filesystem. Otherwise, possible damage or loss to data in the quota
files can result. It is also unwise to run quotacheck on a live
filesystem as actual usage may change during the scan. To prevent
this, quotacheck 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 -m. You can also make
quotacheck ignore the failure to remount the filesystem read-only with
option -M.
OPTIONS
-b, --backup
Forces quotacheck to make backups of the quota file before writ-
ing the new data.
-v, --verbose
quotacheck reports its operation as it progresses. Normally it
operates silently. If the option is specified twice, also the
current directory is printed (note that printing can slow down
the scan measurably).
-d, --debug
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.
-u, --user
Only user quotas listed in /etc/mtab or on the filesystems spec-
ified are to be checked. This is the default action.
-g, --group
Only group quotas listed in /etc/mtab or on the filesystems
specified are to be checked.
-c, --create-files
Don’t read existing quota files. Just perform a new scan and
save it to disk. quotacheck also skips scanning of old quota
files when they are not found.
-f, --force
Forces checking and writing of new quota files on filesystems
with quotas enabled. This is not recommended as the created
quota files may be out of sync.
-M, --try-remount
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.
-m, --no-remount
Don’t try to remount filesystem read-only. See comment with
option -M.
-i, --interactive
Interactive mode. By default quotacheck exits when it finds an
error. In interactive mode user is asked for input instead. See
option -n.
-n, --use-first-dquot
If the quota files become corrupted, it is possible for dupli-
cate entries for a single user or group ID to exist. Normally
in this case, quotacheck 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).
-F, --format=format-name
Check and fix quota files of 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: vfsold Original quota format with 16-bit UIDs / GIDs, vfsv0
Quota format with 32-bit UIDs / GIDs, 64-bit space usage, 32-bit
inode usage and limits, vfsv1 Quota format with 64-bit quota
limits and usage, rpc (quota over NFS), xfs (quota on XFS
filesystem)
-a, --all
Check all mounted non-NFS filesystems in /etc/mtab
-R, --exclude-root
When used together with the -a option, all filesystems except
for the root filesystem are checked for quotas.
NOTE
quotacheck should only be run by super-user. Non-privileged users are
presumably not allowed to read all the directories on the given
filesystem.
SEE ALSO
quota(1), quotactl(2), fstab(5), quotaon(8), repquota(8), con-
vertquota(8), setquota(8), edquota(8), fsck(8), efsck(8), e2fsck(8),
xfsck(8)
FILES
aquota.user or aquota.group
located at filesystem root with quotas (version 2 quota,
non-XFS filesystems)
quota.user or quota.group
located at filesystem root with quotas (version 1 quota,
non-XFS filesystems)
/etc/mtab names and locations of mounted filesystems
AUTHOR
Jan Kara
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa