Read Linux Quota Kernel Counters with quotastats
quotastats prints a live snapshot of kernel quota-subsystem counters, handy before you go blaming quotas for a slow filesystem. The command reports dquot lookups, reads, writes, cache hits and currently allocated entries. It does not set a limit, scan a filesystem or change quota state.
The route
Jump straight to the step you need, or tick off Done means at the end.
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 change as the system does quota work, so treat any single reading as a point-in-time observation.
1. Confirm the installed command
Locate the executable before building a monitoring check around it. This is an ordinary command and needs no 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 own 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 process before continuing. Do not copy a binary from another host just to make this check pass.
2. Run the read-only statistics query
Run the command with no 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; this is just the output shape, including kernel quota version 6.5.1 from this host. The tool queries the kernel and prints one snapshot, it does not read a selected user, group or filesystem.
The 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
That temporary file only captures this one observation. Remove it once you are done, if it holds data you do not want to keep:
$ rm -- /tmp/quotastats.txt
This is the only state-changing example in the guide, and it only touches the temporary file the previous command created. If you pick 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 the kernel reports.
- 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.
None of these are quota limits, usage totals or a list of users over quota. A high lookup count does not by itself mean a fault, and a low read count does not prove enforcement is off. Compare repeated samples against the host's actual workload rather than treating one number as a universal threshold.
4. Take comparable samples
For a quick before-and-after look, save two outputs and diff them. This stays 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 doing quota work. No change is not proof the quota subsystem is broken, it may just mean nothing relevant happened in that window. For a time series, use a monitored job that records the command's output and exit status under your retention policy.
Clean up both temporary captures once the comparison is done:
$ 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 above.
Reach for the quota administration tools proper to your task when you need limits, per-user usage, quota-file checks or quota activation. Those operations can change persistent or service-visible state, so review their manpages and take a backup or maintenance window before using any of them. Running quotastats itself needs no undo, since it changes nothing.
Done means
/usr/sbin/quotastatsis 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 tell activity counters apart from quota limits and usage reports.
- Repeated samples were compared against context, not against invented thresholds.
- Any temporary capture files were removed or filed under your approved retention policy.
- No quota limits, quota files, mounts or services were changed.