Fix 'Disk quota exceeded' errors on Linux
You hit a disk quota limit on your Linux system. Here's how to find the quota, free up space, and adjust limits.
Quick answer
Run quota -vs to see your current usage and limits. If you're over, delete files with find /home/youruser -type f -size +100M -exec ls -lh {} \; to find big ones, then rm them. For a permanent fix, ask your admin to raise your quota with edquota -u youruser.
What's actually happening here is that your Linux filesystem has per-user or per-group limits on disk space or inode count. When you try to write a file that pushes you past that limit, the kernel stops you with EDQUOT (errno 122). This usually shows up as "Disk quota exceeded" in shell commands, or write failed: Disk quota exceeded in apps. Common triggers: a runaway log file, a big download, or just accumulating cache files over months.
Step-by-step fix
Step 1: Check your quota usage
Run this to see what your limits are and how much you've used:
quota -vs
You'll see something like:
Disk quotas for user jdoe (uid 1001):
Filesystem blocks quota limit grace files quota limit grace
/dev/sda1 99000 50000 55000 none 8 0 0
The blocks column is your current usage in 1K blocks. quota is the soft limit (you can exceed it during a grace period), limit is the hard limit (absolute maximum). If you're over the hard limit, you can't write anything until you free up space.
Step 2: Find big files in your home directory
Look for files over 100 MB:
find /home/youruser -type f -size +100M -exec ls -lh {} \;
Replace /home/youruser with your actual home path. That command prints file sizes and paths. If you're hitting inode limits (the files column in quota output), instead look for many small files:
find /home/youruser -type f | wc -l
Step 3: Delete or archive the culprits
Remove files you no longer need with rm. Be careful — there's no undo. For log files or cache directories you want to keep but shrink:
truncate -s 0 ~/.cache/large-cache-file
That empties the file without deleting it, which frees blocks immediately.
Step 4: Verify you're under the limit
Run quota -vs again. You should see blocks dropped below your quota. Now try writing a test file:
touch ~/testfile
No error means you're back in business.
What if you can't delete enough?
If you've cleared everything you can and still can't get under the limit, you need to ask your system administrator to raise your quota. They can do it with:
sudo edquota -u youruser
That opens an editor where they can increase the soft and hard limits. After saving, your new limits apply immediately — no reboot needed.
If you're on a shared hosting environment where you don't have sudo, you're stuck with asking support. Some hosts offer a control panel UI for quota management.
Preventing this in the future
Monitor your usage regularly
Throw this in your crontab to get a weekly email:
0 9 * * 1 quota -vs | mail -s "Your quota report" youruser@example.com
Set up log rotation
If you run services that generate logs, configure logrotate to keep only, say, 7 days of logs. For ~/logs/:
cat > ~/logrotate.conf << 'EOF'
/home/youruser/logs/*.log {
weekly
rotate 4
compress
missingok
notifempty
}
EOF
Then run logrotate ~/logrotate.conf periodically.
Know your inode limits
Small files eat inodes faster than disk space. If your quota shows files near the limit, avoid creating thousands of tiny files — think about consolidating them into archives or databases.
Was this solution helpful?