Skip to content

Running fixquotas safely on a busy cPanel server

fixquotas rebuilds the kernel quota database from disk reality. On a busy server it can take an hour. How to run it without breaking writes mid-flight.

/usr/local/cpanel/scripts/fixquotas is the answer when quota reports diverge from reality across many users. It is also a script that walks the entire filesystem to recompute usage — on a server with 200 cPanel accounts and a 4 TB /home, an hour is not unusual. Running it during peak hours is workable but not ideal; running it during a backup window is asking for trouble.

What’s happening

fixquotas calls quotacheck against /home (and any other mounted filesystem with quotas) and then reapplies cPanel’s per-account caps. During the scan, kernel quota enforcement is paused — writes succeed, but per-user totals are not enforced until the scan completes. If fixquotas is interrupted, the quota state can be left half-applied, and the only safe recovery is to run it again to completion.

How to verify

Before running, get a baseline:

df -h /home
quotacheck -avug --no-mount-check
/usr/local/cpanel/scripts/fixquotas --help
tail -f /var/log/quota_repair_history.log

Estimate the time budget by file count: find /home -xdev -type f | wc -l. Roughly, plan one minute per 200,000 files on commodity SAS storage, half that on NVMe.

The fix

  1. Schedule the run outside the JetBackup/R1Soft window and outside peak traffic. Backups and fixquotas both pound the disk — concurrent execution doubles wall-clock time for both.
  2. Notify affected stakeholders: writes still succeed, but quota enforcement is briefly relaxed. For high-trust environments that’s fine; for shared hosting with abusive accounts known to be at the cap, plan a short maintenance window.
  3. Run: nohup /usr/local/cpanel/scripts/fixquotas > /var/log/fixquotas-run.log 2>&1 &. Putting it under nohup is not paranoid — losing the SSH session mid-run on a busy server is common, and a partial run is the worst outcome.
  4. Monitor in another terminal: tail -f /var/log/fixquotas-run.log and iostat -x 5. Disk wait spiking above 50% means you’re impacting site responsiveness — keep watch.
  5. After completion, spot-check three accounts known to be near their cap with quota -u and confirm the numbers match a manual du -sh. If they don’t, the next step is filesystem fsck, not another fixquotas run.

For environments where these maintenance tasks need to be scheduled and supervised, Stack Harbor runs them as part of cPanel/WHM management.