quotacheck(8)

๐Ÿ“ฆ
version 4.11 ยท 4 versions
, in alpine 3.24, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

๐ŸŒธ quotacheck(8) โ€” the girlies' guide to scanning filesystems for disk usage ๐Ÿฆ‹

okay so bestie, this is quotacheck from the System Manager's Manual, and no cap it's the moment your quota files get a full glow-up. She scans, she builds, she compares, she fixes. main character energy fr fr. โœจ


โœจ NAME โœจ

quotacheck โ€” scan a filesystem for disk usage, create, check and repair quota files ๐Ÿ’…


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

quotacheck [ -gubcfinvdMmR ] [ -F quota-format ] -a | filesystem

๐Ÿ’– DESCRIPTION ๐Ÿ’–

okay so here's the tea. quotacheck goes through each filesystem one by one, builds a whole table of current disk usage, and then compares that table against whatever's recorded in the disk quota file for that filesystem. (lowkey, that comparison step gets skipped entirely if you pass -c.) and if it spots any inconsistencies? she updates both the quota file and the current system copy of the incorrect quotas. (that second one only happens if you're checking an active filesystem, which โ€” bestie, no. not advised. ๐Ÿ™ˆ)

by default, only user quotas get checked. and quotacheck expects every filesystem it's checking to have quota files named [a]quota.user and [a]quota.group sitting at the root of the associated filesystem. if a file isn't there? she just creates it. iconic. ๐Ÿ’…

now, if the quota file is corrupted, quotacheck tries to save as much data as she possibly can. rescuing data may need user intervention โ€” so with no additional options, quotacheck will simply exit in that situation. when you're in interactive mode (that's option -i), the user gets asked for advice. advice can also come from the command line (see option -n), which is super useful when quotacheck is being run automatically (ie. from a script) and failure is simply not acceptable. ๐Ÿซถ

quotacheck should be run each time the system boots and mounts non-valid filesystems. that's most likely to happen after a system crash. ๐Ÿ˜ญ

and here's the big one: 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's also unwise to run quotacheck on a live filesystem, because actual usage may change during the scan. to prevent that, quotacheck tries to remount the filesystem read-only before starting the scan, and after the scan is done she remounts it read-write. you can disable that with option -m. you can also make quotacheck ignore the failure to remount the filesystem read-only with option -M.

โœจ vibe check: read-only remount = the safe girly route. don't skip it unless you know what you're doing.

๐Ÿ‘‘ OPTIONS ๐Ÿ‘‘

  • -b, --backup โ€” forces quotacheck to make backups of the quota file before writing the new data. back it up bestie, always. ๐ŸŽ€
  • -v, --verbose โ€” quotacheck reports its operation as it progresses. normally she operates silently. if you specify the option twice, the current directory also gets printed (note that printing can slow down the scan measurably). ๐Ÿ˜ญ
  • -d, --debug โ€” enable debugging mode. it results 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 specified 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're 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're 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, the user is asked for input instead. see option -n. ๐Ÿ’ฌ
  • -n, --use-first-dquot โ€” if the quota files become corrupted, it's possible for duplicate entries for a single user or group ID to exist. normally in this case, quotacheck exits or asks the 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. so like, know your place bestie (affectionately). ๐Ÿ‘‘


๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹

quota(1), quotactl(2), fstab(5), quotaon(8), repquota(8), convertquota(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 <jack@suse.cz>

based on old quotacheck by:

  • Edvard Tuinder <ed@elm.net>
  • Marco van Wieringen <mvw@planets.elm.net>

and that's the whole page, bestie!! this came out of the System Manager's Manual on Fri Jul 20 2001, and it's still serving quotacheck(8) realness. periodt. ๐Ÿ’–โœจ๐ŸŽ€