Affected versions: Debian 12

📖 ~1 min read

Table of contents
  1. Symptom & Impact
  2. Environment & Reproduction
  3. Root Cause Analysis
  4. Quick Triage
  5. Step-by-Step Diagnosis
  6. Solution – Primary Fix
  7. Solution – Alternative Approaches
  8. Verification & Acceptance Criteria
  9. Rollback Plan
  10. Prevention & Hardening
  11. Related Errors & Cross-Refs
  12. References & Further Reading

Symptom & Impact

Critical operations fail with no-space errors, causing outages and patch delays.

Environment & Reproduction

Typical on long-running systems with unchecked log and cache growth.

df -h
sudo apt update
journalctl -p err -n 30 --no-pager

Root Cause Analysis

Root filesystem saturation from logs, caches, old kernels, or container artifacts.

Quick Triage

Identify highest consumers under root quickly.

sudo du -xhd1 / | sort -h
sudo du -xhd1 /var | sort -h
sudo journalctl --disk-usage

Step-by-Step Diagnosis

Audit cache, logs, stale files, and deleted-open handles.

sudo du -sh /var/cache/apt/archives /var/log /var/lib/docker 2>/dev/null
ls /boot | grep -E 'vmlinuz|initrd'
sudo lsof +L1 | head
Illustrative mockup for debian-12 — terminal_or_shell
Locating large directories on root — Illustrative mockup — Progressive Robot

Solution – Primary Fix

Free space safely, then retry failed package and service operations.

Still having issues? Our Server Management team can diagnose and resolve this for you. Get in touch for a free consultation.

sudo apt clean
sudo journalctl --vacuum-time=7d
sudo apt autoremove -y
sudo apt update
Illustrative mockup for debian-12 — log_or_config
Cleaning cache and logs safely — Illustrative mockup — Progressive Robot

Solution – Alternative Approaches

Relocate high-growth directories to larger secondary volumes.

sudo systemctl stop docker || true
sudo rsync -aHAX /var/lib/docker/ /mnt/data/docker/
sudo mount --bind /mnt/data/docker /var/lib/docker

Verification & Acceptance Criteria

Free space restored and apt checks pass cleanly.

df -h /
sudo apt update
sudo apt-get check

Rollback Plan

Undo temporary mounts and restore archived data if required.

sudo umount /var/lib/docker 2>/dev/null || true
sudo systemctl restart systemd-journald
df -h

Prevention & Hardening

Add monitoring and retention controls for logs and caches.

journalctl --vacuum-size=500M
systemctl list-timers | grep -E 'apt|logrotate'
df -h

Related to initramfs write failures and interrupted package configuration.

Related tutorial: View the step-by-step tutorial for Debian 12.

View all Debian 12 tutorials on the Tutorials Hub →

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

Debian storage, apt cache, and journald retention documentation.

Need Expert Help?

If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today — we respond within one business day.