Affected versions: FreeBSD 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

Package installs, services, and temporary files fail due to no space left on /var.

Environment & Reproduction

Often caused by verbose debug logging or repeated crash dumps.

df -h /var
du -xhd1 /var | sort -h
ls -lh /var/log

Root Cause Analysis

Unbounded log or spool growth exceeds partition sizing and rotation policy.

Quick Triage

Identify top consumers and clear safe transient artifacts first.

find /var -xdev -type f -size +200M -print
ls -lh /var/crash
newsyslog -n

Step-by-Step Diagnosis

Correlate growth to specific service logs and rotation failures.

tail -n 100 /var/log/messages
grep -v '^#' /etc/newsyslog.conf | head -n 40
service syslogd status
Illustrative mockup for freebsd-12 β€” terminal_or_shell
disk usage and log growth analysis β€” Illustrative mockup β€” Progressive Robot

Solution – Primary Fix

Rotate/truncate excessive logs and enforce immediate log management cycle.

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

newsyslog
find /var/log -type f -name '*.0' -delete
rm -f /var/crash/*
service syslogd restart
Illustrative mockup for freebsd-12 β€” logs_or_journal
post-cleanup capacity and logging verification β€” Illustrative mockup β€” Progressive Robot

Solution – Alternative Approaches

Move high-volume logs to dedicated dataset/partition and set quotas.

zfs create zroot/varlog 2>/dev/null || true
zfs set quota=5G zroot/varlog 2>/dev/null || true

Verification & Acceptance Criteria

Free space returns above threshold and log growth follows policy.

df -h /var
du -xhd1 /var/log | sort -h
newsyslog -n

Rollback Plan

Restore archived logs if audit requirements demand complete historical retention.

tar -tf /root/log-backup.tar.gz | head

Prevention & Hardening

Tune rotation policy and alert when /var exceeds safe utilization.

grep -v '^#' /etc/newsyslog.conf
cronjob='*/10 * * * * /bin/df -h /var | /usr/bin/mail -s var-usage root'

Commonly linked to pkg database failures and service crash loops.

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

View all FreeBSD 12 tutorials on the Tutorials Hub β†’

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

FreeBSD logging, newsyslog, and capacity planning 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.