Bash error: "Disk quota exceeded"

"Disk quota exceeded" means your user hit a filesystem quota, not a full disk. Diagnose with quota -s and repquota, then free space or raise the limit.

Error String

bash: cannot write file.txt: Disk quota exceeded

Tldr

"Disk quota exceeded" (EDQUOT) means your user or group has hit an administrator-set quota on a filesystem that supports quotas (common on shared servers and NFS). This is different from "No space left on device", which means the whole disk is full. Check usage with `quota -s` and free up space or ask an admin to raise the limit.

Cause

Many multi-user systems enforce per-user or per-group disk quotas with the quota subsystem (ext4/xfs with quota mount options, or NFS server-side quotas). Once your usage — files or inodes — reaches the soft/hard limit, writes fail with EDQUOT even though the underlying disk has free space for other users. This commonly bites users on shared hosting, university clusters, and home directories mounted over NFS.

Repro

$ dd if=/dev/zero of=~/bigfile bs=1M count=2000
bash: cannot write bigfile: Disk quota exceeded

Fix

#!/usr/bin/env bash
set -euo pipefail

# Check your current usage against soft/hard limits
quota -s

# Find your biggest files/directories to clean up
du -sh ~/* | sort -rh | head -n 20

# Remove or move large files outside your quota'd home
rm ~/old-backups/*.tar.gz

# Ask an admin to check/raise the quota if usage is legitimate
sudo repquota -a   # admin-only, shows all users' quotas

Explanation

Do not confuse this with "No space left on device" (ENOSPC), which means the physical/logical volume is full for everyone. `df -h` shows overall disk usage; `quota -s` shows your personal allocation. Cleaning up files under your quota, moving data to a different mount, or requesting a quota increase are the only fixes.

Faq

Q

Is this the same as the disk being full?

A

No. "No space left on device" means the whole filesystem is full. "Disk quota exceeded" means only your allotted share is full — `df -h` may still show plenty of free space overall.

Q

Why did a small file trigger this when I have space left in my quota?

A

Quotas often limit inodes (file count) as well as bytes. Many small files can exhaust an inode quota well before the byte quota is reached; check both with `quota -s`.

Q

Can I see the quota without root access?

A

Yes, `quota -s` (or plain `quota` for terse output) reports your own limits and current usage without needing elevated privileges.