Postfix reports No space left on device in your logs. You check df -h /var/spool/postfix and see 50% free space. Mail acceptance is failing and queue operations are erroring. The obvious explanation does not match reality.

The cause is almost always inode exhaustion on the queue filesystem. Postfix creates one file per queue entry: every incoming message, every deferred retry, every bounce notification. Each file consumes one inode regardless of how few bytes it occupies. A deferred queue with 500,000 tiny messages might use only a couple of GB of block space but exhaust every inode on the partition.

The fix is to clean the queue and address the underlying growth cause. The prevention is to monitor df -i explicitly, because monitoring df -h alone will never warn you about this failure mode.

What this means

Postfix stores mail in multiple queues under /var/spool/postfix/: maildrop/, incoming/, active/, deferred/, hold/, corrupt/, bounce/, and defer/. Every message in every queue is a separate file on disk. Postfix also writes per-message metadata files in defer/ and bounce/ for delivery status records. A single message that fails delivery and generates a bounce can create files across three or four queue subdirectories.

When the filesystem runs out of inodes, the kernel returns ENOSPC on file creation. Postfix logs this as No space left on device (specifically, mail_queue_enter: create file maildrop/xx.xx: No space left on device or similar). The error string is identical whether the filesystem ran out of blocks or inodes, which is why checking df -h alone is misleading.

On ext4, the inode pool is fixed at filesystem creation time. The default bytes-per-inode ratio allocates roughly one inode per 16 KiB of filesystem space. A 20 GB partition gets approximately 1.3 million inodes. A Postfix server accumulating bounce messages or a runaway deferred queue can exhaust that faster than you would expect.

On XFS, inodes are allocated dynamically up to a configurable percentage of the filesystem. This makes XFS more resistant to inode exhaustion than ext4, but it is not immune. A sufficiently large queue will still hit the ceiling.

The degradation is cliff-edge, not gradual. Operations succeed until the last inode is consumed, then every file creation fails immediately.

flowchart TD
    A[Mail accepted faster than delivered] --> B[Deferred queue grows]
    B --> C[Bounce and defer metadata files accumulate]
    C --> D[Inode count climbs toward ceiling]
    D --> E{Inodes exhausted?}
    E -- No --> B
    E -- Yes --> F[creat and open return ENOSPC]
    F --> G[Postfix logs: No space left on device]
    G --> H[Queue file creation fails]
    G --> I[PID and lock file writes fail]
    G --> J[df -h still shows free space]

Common causes

CauseWhat it looks likeFirst thing to check
Runaway deferred queueDelivery to one or more destinations failing; deferred queue growing rapidlyfind /var/spool/postfix/deferred -type f | wc -l and deferral reasons in mail.log
Bounce stormMassive bounce generation to forged or invalid senders; MAILER-DAEMON dominating the queuegrep 'status=bounced' /var/log/mail.log | tail -20 and queue sender distribution
Double-bounce loopBounces of bounces multiplying; metadata files in bounce/ and defer/ growing fastpostqueue -p | grep MAILER-DAEMON | wc -l and find /var/spool/postfix/bounce -type f | wc -l
Small ext4 partition with default inode densityPartition sized correctly for bytes but inode count too low for Postfix workloaddf -i /var/spool/postfix showing high IUse% relative to expected capacity
Stale queue never cleanedOld deferred messages accumulating over weeks or months, never expiringfind /var/spool/postfix/deferred -type f -mtime +5 | wc -l compared to maximal_queue_lifetime

Quick checks

These commands are read-only and safe to run at any time.

# Check inode usage on the queue filesystem
df -i /var/spool/postfix

# Compare with block space usage (often diverges dramatically)
df -h /var/spool/postfix

# Global inode state (first number: allocated, second: free)
cat /proc/sys/fs/inode-nr

# Total file count across all queue subdirectories
find /var/spool/postfix -type f 2>/dev/null | wc -l

# Per-subdirectory counts to identify which queue is hoarding inodes
for d in maildrop incoming active deferred hold corrupt bounce defer; do
  count=$(find "/var/spool/postfix/$d" -type f 2>/dev/null | wc -l)
  printf "%-12s %s\n" "$d" "$count"
done

# Look for the specific Postfix error in recent logs
grep -i 'No space left on device\|not enough free space' /var/log/mail.log | tail -20

# Check deferred queue growth rate (compare two snapshots 60 seconds apart)
find /var/spool/postfix/deferred -type f | wc -l && sleep 60 && find /var/spool/postfix/deferred -type f | wc -l

# Verify queue manager is still responsive (may be slow on huge queues)
time postqueue -p | tail -5

How to diagnose it

  1. Confirm inode exhaustion is the cause. Run df -i /var/spool/postfix. If IUse% is at or near 100%, inodes are the problem. If df -h simultaneously shows adequate free space, you have confirmed the divergence.

  2. Identify which queue is consuming inodes. Run the per-subdirectory count loop from the quick checks. The deferred/ directory is the most common culprit, but bounce/ and defer/ can also accumulate large numbers of small metadata files. Postfix hashes entries into subdirectories (deferred/0/ through deferred/F/), so check nested directories too.

  3. Check for subdirectory-level performance cliffs. A single queue subdirectory with more than 10,000 entries can degrade directory operations on ext4, making postsuper cleanup slow even before inodes are fully exhausted. Run for d in /var/spool/postfix/deferred/*/; do echo "$(find "$d" -type f | wc -l) $d"; done | sort -rn | head to spot hot hash buckets.

  4. Determine the root cause of queue growth. Check mail.log for deferral reasons: grep 'status=deferred' /var/log/mail.log | tail -50. Look for patterns such as a single slow destination monopolizing delivery, DNS failures causing universal deferrals, or bounce storms generating massive local submissions. The qshape utility (shipped with Postfix) breaks down queue depth by recipient domain and is useful here: qshape deferred | head -20.

  5. Estimate runway. If inodes are not yet exhausted but trending upward, calculate how many hours remain at the current growth rate. Subtract free inodes from the growth rate observed in step 2 of the quick checks. If the rate is accelerating due to retry backoff compounding, treat the estimate as optimistic.

  6. Check for double-bounce loops. If bounce/ and defer/ are the dominant consumers, look for MAILER-DAEMON messages multiplying in the queue. Double-bounces are discarded by default, but a misconfigured bounce pipeline can create metadata files faster than they are cleaned.

Metrics and signals to monitor

SignalWhy it mattersWarning sign
Inode usage on queue filesystem (df -i)Direct indicator of the failure mode>80% used, or fewer than 10,000 free inodes
Block space usage (df -h)Often diverges from inode usage; monitoring this alone misses the problem entirelyNormal while inode usage is critical
Total queue file countProxy for inode consumption; correlates with growth rate>50% of filesystem inode capacity
Deferred queue sizePrimary accumulator of inodes in most incidentsSustained growth exceeding 100 files/hour
Per-subdirectory entry countsDetects ext4 directory performance cliff before full exhaustionAny single subdirectory exceeding 10,000 entries
Deferred queue growth rate (velocity)Leading indicator; rate of change predicts time to exhaustionSustained positive growth over 4 or more hours
No space left on device errors in mail.logConfirms Postfix has hit the wallAny occurrence means active file creation failure
Bounce rateBounce storms create secondary inode consumers>1% sustained, or sudden 10x spike from baseline

Fixes

Emergency: drain the consuming queue

If mail acceptance has stopped, the immediate priority is freeing inodes. The deferred queue is almost always the largest consumer.

# Count what you are about to delete
find /var/spool/postfix/deferred -type f | wc -l

# WARNING: deletes ALL deferred mail. Irreversible. Use only in emergency.
postsuper -d ALL deferred

Deleting deferred messages with postsuper cascades to their associated defer/ and bounce/ metadata records. If orphaned metadata (message files already gone, stale defer/bounce entries left behind) is the problem, run postsuper -s to clean up structural inconsistencies.

postsuper -d ALL without a queue name deletes all messages across all queues (maildrop, incoming, active, deferred, hold). This is destructive and irreversible.

If you need to preserve mail but stop retry-driven growth, hold the queue instead of deleting:

# Hold all deferred mail (preserves messages, stops retry scheduling)
postsuper -h ALL deferred

Holding does not free inodes. It only stops the qmgr from generating additional retry-related metadata. You still need to delete or deliver the held mail to reclaim inodes.

Cleanup is slow under pressure

postsuper -d is I/O-bound and single-threaded. On a filesystem near inode exhaustion, deletion itself is slow because the kernel must update directory structures and inode bitmaps for every removed file. A cleanup of hundreds of thousands of files can take hours. This is why maintaining >20% free inodes (50% preferred) matters: the headroom is needed for cleanup operations to run at reasonable speed. Do not wait until you are at 99% to start cleaning.

Fix the root cause of queue growth

Deleting the queue without addressing why it grew is a temporary fix. Common root causes:

Long-term: increase inode capacity

If the filesystem is structurally too small for the Postfix workload, cleanup alone will not prevent recurrence.

  • On ext4: the inode count is fixed at mkfs time. You cannot increase it without reformatting. When provisioning a new queue partition, use mkfs.ext4 -T small or specify bytes-per-inode explicitly (-i) to increase inode density.
  • On XFS: inodes are allocated dynamically up to a configurable percentage. Verify the allocation ceiling with xfs_info and increase it if needed. XFS is more forgiving than ext4 but still monitor.
  • Separate the queue filesystem: place /var/spool/postfix on its own partition or logical volume so that other filesystem consumers (logs, package caches) do not compete for the same inode pool.

Prevention

  • Monitor df -i on the queue filesystem explicitly. This is the single most important change. Standard disk space monitoring will never catch this failure mode. Alert at 80% inode usage, page at 90%.
  • Track deferred queue growth rate, not just absolute size. A deferred queue of 10,000 messages that is shrinking is healthy. The same 10,000 growing at 500 messages/hour is a crisis in progress. Alert on sustained positive growth over 4-hour windows.
  • Set per-subdirectory monitoring. Alert when any single queue subdirectory exceeds 10,000 entries. This catches ext4 directory performance degradation before it turns into full exhaustion.
  • Automate periodic queue cleanup. For high-volume servers, schedule regular removal of deferred mail past maximal_queue_lifetime (default 5 days). This prevents slow accumulation from eventually hitting the wall.
  • Size the queue filesystem for inodes at provisioning time. Calculate expected peak queue depth during worst-case destination failure, multiply by 4 (for metadata files across subdirectories), and ensure the filesystem has enough inodes for that plus 50% headroom.
  • Keep >20% free inodes, 50% preferred. The headroom is not just for safety margin. postsuper -d cleanup needs working space to operate efficiently. Near exhaustion, cleanup itself becomes painfully slow.

How Netdata helps

Netdata collects the signals that distinguish inode exhaustion from a genuine disk-full condition:

  • Filesystem inode metrics are collected per-second per mount point, showing inode consumption trending toward the ceiling before the cliff.
  • Block space and inode metrics appear together in the same dashboard, making the divergence immediately visible: block usage normal while inode usage spikes.
  • Postfix queue size metrics provide a proxy for total inode consumption. Combined with Netdata’s rate calculation, this enables velocity-based alerting on queue growth.
  • ML-based anomaly detection on inode usage rate can flag slow, chronic accumulation that precedes acute exhaustion, even when absolute counts remain below static thresholds.

For inode-specific alerting, configure an alarm on the filesystem inode utilization metric for the queue filesystem mount point.