Emergency server help: get in touch

Disk full on a production server: recovery runbook Pro

A recovery runbook for a disk full on a production server: safe space to free first, inode exhaustion, what never to delete, and how to bring MySQL, Exim and Dovecot back cleanly after ENOSPC.

Published Updated 9 min read
ProThis is part of srvScripts Pro. See what Pro includes.

A disk full event on a production server rarely stays a disk problem. MySQL stops writing and sites show database errors, Exim cannot create spool files, PHP cannot save sessions so logins fail, and backups die halfway. The fix is almost always a few gigabytes away, but the fastest-looking deletions (a MySQL file, an open log, the mail spool) are exactly the ones that turn an outage into data loss. This runbook frees space in order of safety, then brings each service back properly.

Short answer: Find the full filesystem with df -h and df -i (blocks or inodes), then free space in order of safety: restart services holding deleted files (lsof +L1), vacuum the journal and package caches, move local backups and migration leftovers off the server, and purge MySQL binary logs with PURGE BINARY LOGS, never rm. Never delete files in the MySQL data directory, the mail spool or open logs. Afterwards, check that MariaDB, Exim and PHP sessions recovered. (Reviewed October 2026.)

srvScripts Pro

The rest of this is for Pro members.

Pro removes ads and adds Pro scripts, runbooks, 50 monitors, the Tools API and a bigger AI quota — and it keeps the free tools free.

See Pro plansSign in

Free website test

Is your website set up right?

Check SSL, security headers, redirects, robots.txt, sitemap, llms.txt and security.txt in one test. It takes about 30 seconds.