Skip to content

Disk Full / System Slow

Symptom: system feels sluggish; calls drop randomly; Apply Config hangs; logs say "no space left on device."

Most Likely Causes

  1. Voicemail messages accumulating — VM-to-email working but Delete Voicemail = No, files pile up forever.
  2. Call recordings not pruned/var/spool/asterisk/monitor/ grows unbounded.
  3. Asterisk full log not rotating/var/log/asterisk/full reaches GBs.
  4. MariaDB binlogs unrotated.
  5. System backups stored locally without rotation.
  6. Old Sangoma module cache.

Diagnose

# Where's the space gone?
df -h
du -sh /var/spool/asterisk/voicemail/ /var/spool/asterisk/monitor/ \
       /var/log/asterisk/ /var/lib/mysql/ /var/spool/asterisk/backup/ 2>/dev/null

# Top 20 largest files:
find / -type f -size +100M 2>/dev/null | head -20

Fix

Match what's eating disk:

  • Voicemail: for each extension, set Delete Voicemail = Yes (assuming VM-to-email is on, the email is the persistent copy). Then prune existing:
    find /var/spool/asterisk/voicemail/ -name "msg*.wav" -mtime +90 -delete
    
  • Recordings: add a cron to retain 90 days:
    echo '0 3 * * * find /var/spool/asterisk/monitor -type f -mtime +90 -delete' \
      >> /etc/crontab
    
  • Asterisk log: verify logrotate config:
    cat /etc/logrotate.d/asterisk
    logrotate -f /etc/logrotate.d/asterisk
    
    Truncate live: > /var/log/asterisk/full.
  • MariaDB binlogs: PURGE BINARY LOGS BEFORE NOW() - INTERVAL 7 DAY; in mysql.
  • Backups: System Admin → Backup & Restore → backup template → Maintenance → keep last 7.
  • Module cache: rm -rf /var/cache/php/*, fwconsole cache clean.

When to Escalate

Disk filling fast with no obvious culprit. Run iotop -o to see who's writing. May be a misbehaving module (look for repeating debug logs).