Home / Alt manpages / quotastats(8)

  • quotastats(8)
  • Admin command
  • linux

Read Linux Quota Kernel Counters with quotastats

You will finish with a repeatable, read-only check of the quota statistics held by the Linux kernel. The command reports counters such as dquot lookups, reads, writes, cache hits and currently allocated entries. It does not set a limit, scan a filesystem or change quota state.

Allow about ten minutes. You need the quota package and a shell on the Linux host you want to inspect. The examples below use the locally installed quota package version 4.06-1build6. The counters are host-specific and will change as the system does quota work, so treat the numbers as a point-in-time observation.

1. Confirm the installed command

Locate the executable before building a monitoring check. This is an ordinary command and does not need elevated privileges:

$ command -v quotastats
/usr/sbin/quotastats
$ dpkg-query -W -f='${Package} ${Version}\n' quota
quota 4.06-1build6

The manpage names /usr/sbin/quotastats as the command. Calling that path directly avoids accidentally testing a different executable earlier in PATH. On a non-Debian system, use that distribution's package query tool or record the package version from its installed package database.

Checkpoint

You should have an executable path and a package version. If command -v prints nothing, install the quota tools through your normal operating system process before continuing. Do not copy a binary from another host merely to make this check pass.

2. Run the read-only statistics query

Run the command without arguments:

$ /usr/sbin/quotastats
Kernel quota version: 6.5.1
Number of dquot lookups: 33795916
Number of dquot drops: 31965039
Number of dquot reads: 73
Number of dquot writes: 421284
Number of quotafile syncs: 96208
Number of dquot cache hits: 33795843
Number of allocated dquots: 73
Number of free dquots: 12
Number of in use dquot entries (user/group): 61

Your values will differ. The example shows the output shape from this host, including kernel quota version 6.5.1. The tool queries the kernel and prints one snapshot; it does not read a selected user, group or filesystem.

The command's exit status is useful for a simple health check:

$ /usr/sbin/quotastats >/tmp/quotastats.txt
$ status=$?
$ printf 'quotastats exit status: %s\n' "$status"
quotastats exit status: 0

The temporary file is only for capturing this observation. Remove it after inspection if it contains data you do not want to retain:

$ rm -- /tmp/quotastats.txt

This is the only state-changing example in the guide, and it changes only the temporary file created by the preceding command. If you choose a different path, check it first and remove only that exact file.

3. Read each counter without over-interpreting it

dquot is the quota subsystem's in-memory representation of a user or group quota record. The labels describe activity and cache state:

  • Kernel quota version identifies the quota interface version reported by the kernel.
  • Dquot lookups count attempts to find quota records.
  • Dquot drops count records removed from the in-memory cache.
  • Dquot reads and dquot writes count quota records read from or written to quota storage.
  • Quotafile syncs count synchronisation operations for quota files.
  • Dquot cache hits count lookups satisfied by an existing cached record.
  • Allocated dquots and free dquots show allocated and available in-memory entries.
  • In use dquot entries reports the entries currently in use for users and groups.

These are not quota limits, usage totals or a list of users over quota. A high lookup count does not by itself indicate a fault, and a low read count does not prove that quota enforcement is inactive. Compare repeated samples in the context of the host's workload rather than treating one absolute value as a universal threshold.

4. Take comparable samples

For a quick before-and-after observation, save two outputs and compare them. This remains unprivileged and does not enable or disable quotas:

$ /usr/sbin/quotastats >/tmp/quotastats-before.txt
$ sleep 60
$ /usr/sbin/quotastats >/tmp/quotastats-after.txt
$ diff -u /tmp/quotastats-before.txt /tmp/quotastats-after.txt

Changed counters are expected if the machine is handling quota activity. A sample with no changes is not proof that the quota subsystem is broken; it may simply mean no relevant work occurred during the interval. If you need a time series, use a monitored job that records the command's output and exit status according to your retention policy.

Clean up the two temporary captures when the comparison is complete:

$ rm -- /tmp/quotastats-before.txt /tmp/quotastats-after.txt

5. Know what quotastats cannot answer

The installed manpage documents no options. Do not invent a filesystem, user or group argument, and do not expect a verbose mode or a reset switch. The command only queries and displays the kernel statistics described above.

Use the quota administration tools appropriate to your separate task when you need limits, per-user usage, quota-file checks or quota activation. Those operations can change persistent or service-visible state. Review their own manpages and take a backup or maintenance window before using any command that edits quota configuration. Running quotastats itself requires no undo operation because it does not modify quota configuration.

Done means

  • /usr/sbin/quotastats is present and its installed package version is recorded.
  • A no-argument run returns status 0 and prints the kernel quota version and counters.
  • You can distinguish activity counters from quota limits and usage reports.
  • Repeated samples are compared in context rather than against invented thresholds.
  • Any temporary capture files have been removed or placed under your approved retention policy.
  • No quota limits, quota files, mounts or services were changed.