Pcornel
Browse topics
Options
Recent
Favorites
Databases · Technical reference

Disk Full on Database Servers

Direct answer

Disk full on a database server stops writes or the whole server. Common causes: data growth, WAL/binlog/transaction log not truncating, temp files, backups or logs on the same disk.

When to use this

Use it when the database disk is full or filling fast.

First 30 seconds

1. df -h — which filesystem?

2. Largest: data, WAL (pg_wal), binlogs, log files, temp, backups.

3. PG: archiver failures, inactive slots.

4. MySQL: PURGE BINARY LOGS after replicas/backups are safe.

5. SQL Server: log_reuse_wait_desc.

Operational verification

growth or retained logs → disk fills → cause fixed → space freed safely

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
MariaDB / MySQL / PostgreSQL / Microsoft SQL Server concepts
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformMariaDB / MySQL / PostgreSQL / Microsoft SQL Server concepts
Scope / prerequisiteUse it when the database disk is full or filling fast.
What next?2 suggested next steps
Evidence0
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 How to verify Verify boundary

After freeing space, confirm the database accepts writes and the growth cause is fixed. Alert before the disk is full.

Step 2 Common failures Narrow the fault

Deleting WAL or binlog files by hand can make the database unrecoverable. Restarting does not free space if the cause remains. Backups written to the data disk fill it.

Key points

Never delete WAL/log files by hand. Find why logs are retained (archiving failure, inactive slot, missing log backups). Free space safely, then fix the cause.

Key checks
  • df -h — first check for this topic
  • psql -c "SELECT now(), version();" — PostgreSQL reachable and version
  • mysql -e "SELECT NOW(), VERSION();" — MariaDB/MySQL reachable and version
  • sqlcmd -S <server> -Q "SELECT @@VERSION" — SQL Server reachable and version
ReferenceWhat it is1 section · depth on demand

How it works

Logs grow when they cannot be recycled: missing log backups, stuck replication, failed archiving. Large sorts and hash joins spill to temporary files when memory is not enough.

ReferenceImportant terms & boundaries3 sections · depth on demand

Recovering from a full disk

1. Find what grew: data, logs (WAL/binlog/transaction log), temp files, backups, error logs.

2. Free space safely: purge old binlogs with PURGE BINARY LOGS, take a log backup in SQL Server, drop inactive replication slots in PostgreSQL — never delete WAL or log files by hand.

3. Extend the volume if needed.

4. Fix the cause: retention, monitoring, autovacuum, log backup jobs.

Alert at 80 % and 90 % for database volumes.

In depth

What happens when the disk fills

Disk that fillsPostgreSQLMySQL InnoDBSQL Server
Data filesWrites fail with errors; existing data intactWrites wait/fail (The table is full, error 28)Error 1105 (filegroup full)
Transaction logServer may PANIC and stopServer stops writingError 9002 (log full) — database read-only for writes

Find what grew, without deleting anything yet

df -h; du -xsh /var/lib/postgresql/*/main/{base,pg_wal} /var/lib/mysql/* 2>/dev/null | sort -h | tail
SELECT slot_name, active, wal_status FROM pg_replication_slots;      -- stuck slot?
SELECT failed_count, last_failed_wal FROM pg_stat_archiver;           -- failing archive?
SELECT datname, temp_bytes FROM pg_stat_database ORDER BY 2 DESC;    -- temp files?
SHOW BINARY LOGS;                                                     -- MySQL binlog volume
SELECT name, log_reuse_wait_desc FROM sys.databases;                  -- SQL Server log

Safe ways to free space

CauseSafe action
Stuck PostgreSQL slotDrop the slot if its consumer is gone: SELECT pg_drop_replication_slot('x');
Failing WAL archiveFix the archive target; PostgreSQL then archives and recycles WAL itself
Old MySQL binlogsPURGE BINARY LOGS BEFORE '2026-11-20'; after checking replicas and PITR needs
SQL Server logTake a log backup (FULL model) or fix what log_reuse_wait_desc names
Runaway temp filesCancel the query creating them
Local backup files, server logsMove or delete them

Never delete files inside pg_wal, InnoDB redo/undo files or .ldf files by hand; the database cannot recover without them. As a reserve, keep a few gigabytes of placeholder file on the same filesystem that can be removed in an emergency, and alert well before the disk is full.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Common mistakes

  • Deleting log files the database still needs (WAL/binlogs).
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
disk full on database serversdatabase disk fullwal binlog growth
Confirmation

Confirm action

Continue?