Full disk on a Plesk server
Actions to Recover plesk server
A full disk on a Plesk server can cause major service interruptions, including database crashes, website downtime, and inability to log in to the Plesk control panel. This guide explains how to diagnose the issue, free up space safely, and restart critical services to restore normal operations.
1️⃣ Symptoms of Full Storage
- Plesk commands failing with errors like: DB query failed: Can’t create/write to file ‘/var/tmp/#sql_85c_0.MAI’ (Errcode: 28)
- MySQL service stopping or switching to read-only mode.
- Websites returning 500 Internal Server Error or “Unable to connect to database”.
- Email queues stuck or failing to send/receive.
- SSH commands like
touch
orlogin
may fail due to no space left.
2️⃣ Step-by-Step Actions to Recover plesk server
Step 1: Check Disk Usage
df -h
Shows usage per partition. If /
or /var
is at 100%, cleanup is required immediately.
Step 2: Identify Large Directories
du -sh /* 2>/dev/null | sort -rh | head -20 du -sh /var/* 2>/dev/null | sort -rh | head -20 du -sh /var/www/vhosts/* 2>/dev/null | sort -rh | head -20
Common large folders:
/var/log/
→ System and Plesk logs/var/lib/mysql/
→ Databases/var/lib/psa/dumps/
→ Local Plesk backups/var/www/vhosts/
→ Website data
Step 3: Clean Up Safely
- Clear large log files sudo truncate -s 0 /var/log/messages-debug sudo truncate -s 0 /var/log/agent360.log
- Remove old Plesk backups rm -rf /var/lib/psa/dumps/*
- Delete processed statistics files find /var/www/vhosts/system/ -type f -name ‘*.processed’ -delete
- Clear temporary files rm -rf /tmp/* rm -rf /var/tmp/*
- Rotate or compress logs logrotate -f /etc/logrotate.conf journalctl –vacuum-time=3d
Step 4: Find Large Single Files
find / -xdev -type f -size +500M -exec ls -lh {} \; | sort -k5 -rh | head -20
3️⃣ Restarting Services After Cleanup
Once you free space, restart key Plesk services in this order:
- Database Service systemctl restart mysqld
- Plesk Control Panel systemctl restart sw-engine sw-cp-server psa
- Web Servers systemctl restart httpd systemctl restart nginx
- Mail Services (if used) systemctl restart postfix systemctl restart dovecot
- PHP-FPM Pools systemctl restart plesk-php*-fpm
- Logging systemctl restart rsyslog
Check service status:
systemctl status mysqld httpd psa
4️⃣ Preventing Future Disk Full Issues
- Enable log rotation in Plesk → Tools & Settings → Log Rotation.
- Delete or move local backups regularly.
- Monitor disk usage: watch -n 60 df -h
- Set up alerts for disk usage above 80%.
- Consider resizing disk or adding a dedicated partition for
/var
.
✅ Quick Recovery Script (Optional)
#!/bin/bash truncate -s 0 /var/log/messages-debug /var/log/agent360.log 2>/dev/null rm -rf /tmp/* /var/tmp/* find /var/www/vhosts/system/ -type f -name '*.processed' -delete systemctl restart mysqld sw-engine sw-cp-server psa httpd nginx postfix dovecot rsyslog df -h
Make executable:
chmod +x plesk_free_space.sh
📌 Summary
- Identify large files and directories (
du
,find
). - Clean safely (logs, temp files, old backups).
- Restart services (MySQL, Plesk, Apache/Nginx, Mail).
- Set up monitoring and preventive measures.
This process helps you quickly restore a Plesk server after running out of disk space and avoid future incidents.
Related Posts
This is placeholder text for a H2 headline
Lorem ipsum amet...
This is placeholder text for a H2 headline
Lorem ipsum amet...
This is placeholder text for a H2 headline
Lorem ipsum amet...