Hostxpeed
Login Get Started →
Troubleshooting

Fix "Disk Full" Error

6 min read
33 views
Jun 13, 2026

Understanding Disk Full Errors

When disk is 100% full, you may see:

  • "No space left on device"
  • Unable to write logs or files
  • Services crashing
  • Unable to SSH or run commands (though SSH often still works)

Step 1: Check Disk Usage

df -h

Shows usage per filesystem. Look for 100% or 90%+:

Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        20G   20G     0 100% /

Step 2: Find Large Files

Find largest files on system:

# Top 20 largest files
sudo find / -type f -size +100M -exec ls -lh {} ; 2>/dev/null | sort -k5 -hr | head -20

Or use ncdu (interactive tool):

sudo apt install ncdu -y
sudo ncdu /

Step 3: Common Space Wasters

Log Files

# Check log sizes
du -sh /var/log/

# Rotate/clear logs
sudo journalctl --vacuum-size=200M
sudo truncate -s 0 /var/log/*.log

Package Cache

# Ubuntu/Debian
sudo apt clean
sudo apt autoremove -y

# CentOS/RHEL
sudo yum clean all

Old Kernels

# Ubuntu
sudo apt autoremove --purge

# CentOS
sudo package-cleanup --oldkernels --count=2

Docker

docker system prune -a -f

Backup Files

# Find old backups
find /home -name "*.tar.gz" -mtime +30 -delete
find /home -name "*.zip" -mtime +30 -delete

Step 4: Check Inode Usage

You can run out of inodes (file metadata) before disk space:

df -i

If 100% inodes, delete many small files:

find /home -type f -size 0 -delete  # Delete empty files
find /var/spool/postfix/maildrop -type f -delete  # Clear mail queue

Step 5: Emergency Cleanup

If you cannot run commands, try:

# Delete/tmp contents
sudo rm -rf /tmp/*

# Truncate large log files
sudo truncate -s 0 /var/log/syslog
sudo truncate -s 0 /var/log/auth.log

⚠️ Always investigate what filled the disk to prevent recurrence.

Was this article helpful?