How to Fix 'Disk quota exceeded' Errors on Linux

intermediate🐧 Linux2026-05-23| Linux (Ubuntu, Debian, CentOS, RHEL) using ext4 or XFS file systems with quota-tools installed.

Error Message

Disk quota exceeded
#quota#disk#storage#edquota#linux

The ProblemIt is a frustrating moment: you try to save a configuration file, download a critical package, or run a database migration, but the system pushes back with a cryptic message:

Disk quota exceeded

This error often feels like a lie. You run df -h and see 50GB of free space on the physical disk. So what gives? On multi-user systems, admins set quotas—artificial ceilings on how much data a specific user can own. When you hit this limit, the system locks your account's write permissions, even if the hardware is half-empty.

Step 1: Diagnosing the UsageFirst, confirm the diagnosis. You need to see exactly how close you are to the edge. The quota command provides a snapshot of your current standing.

# Check your own quota in human-readable format
quota -s

Look closely at the blocks (actual space) and inodes (number of files) columns. If the "usage" matches the "limit," you have found the bottleneck. If you have sudo privileges, you can audit every user on the system at once:

sudo repquota -as

Step 2: Hunting for Space HogsIf increasing the limit isn't an option, you need to start deleting. Don't guess where the data is; use du to find the heaviest folders in your home directory.

# Find the top 10 largest directories
du -ah ~ | sort -rh | head -n 10

Watch out for these common offenders:

  • Hidden Runtimes: A ~/.npm or ~/.cache folder can easily balloon to 2GB or 3GB without you ever noticing.- Neglected Logs: Check /var/www/html/logs or your app's local log directory. A single runaway debug log can eat 500MB in a few hours.- The Ghost Trash: Deleting files via a GUI often just moves them to ~/.local/share/Trash. They still count against your quota until that folder is purged.## Step 3: Rapid CleanupNeed to get services back online immediately? These commands target the most likely culprits for a quick win:
# Purge bulky package manager caches
npm cache clean --force
yarn cache clean

# Remove Python bytecode that accumulates in dev environments
find . -name "*.pyc" -delete

# Empty the trash bin via the terminal
rm -rf ~/.local/share/Trash/*

Step 4: Adjusting Limits (For Admins)Sometimes the user just needs more room to do their job. Quotas use a "Soft" limit (a warning zone) and a "Hard" limit (the absolute wall). To change these, use edquota, which opens your default text editor.

sudo edquota -u username

The configuration will look like this:

Disk quotas for user dev_user (uid 1001):
  Filesystem      blocks       soft       hard     inodes     soft     hard
  /dev/sda1      1048576    2097152    2500000         45        0        0

Update the soft and hard blocks. Note that these are typically measured in 1KB blocks, so 2097152 equals 2GB. For a faster, scriptable approach, use setquota:

# Set a 2GB soft limit and 2.5GB hard limit immediately
sudo setquota -u username 2097152 2621440 0 0 /

Verification: Confirming the FixDon't assume it's fixed just because you deleted a few files. Test the write capability with touch:

touch test_file && rm test_file

If the command completes without an error, the block is lifted. Run quota -s one last time to ensure you have a comfortable buffer below your new limit.

Lessons Learned- Watch the Inode Count: You might have 10GB of free space but still see this error if you've hit the inode limit. This happens if you have hundreds of thousands of tiny session files or small logs.- The Grace Period Trap: Once you cross the soft limit, a timer starts (usually 7 days). If you don't drop back below the limit before it expires, the soft limit turns into a hard limit, blocking all writes.- Automate Warnings: Set up a simple cron job to email users when they exceed 80% of their quota. It’s better to clean up on Tuesday than to have a production crash on Friday night.

Related Error Notes