Cookbook recipe

Emergency recovery when the disk is full

Applies to PostgreSQL 13–17 Last reviewed May 2026 Grounded in source
Estimated investigation4 min

Scenario

The data disk hit 100% and PostgreSQL is throwing "No space left on device" or has stopped. Recover without making it worse. Diagnose it Confirm what is consuming space: -- from the OS: -- du -sh…

Investigation Path

The data disk hit 100% and PostgreSQL is throwing “No space left on device” or has stopped. Recover without making it worse.

Diagnose it

Confirm what is consuming space:

-- from the OS:
-- du -sh /var/lib/pgsql/data/*
SELECT slot_name, active FROM pg_replication_slots;

Why it happens

Common culprits: runaway WAL from an inactive replication slot or failing archiver, a massive temp file from a bad query, or log files. The cluster halts writes to avoid corruption.

This is a Pro lesson

Get every Learning Pathway and cookbook recipe — grounded in PostgreSQL source code, with diagnostics, fixes, and prevention for each topic.

Continue this lesson to learn:

  • How to fix it
  • Prevent it next time
  • Related & next steps
  • All 36 Learning Pathway lessons
  • 170+ cookbook recipes
  • Source-grounded diagnostics & fixes

Secure checkout Cancel anytime Source-grounded

Career Impact

This scenario builds production judgment and operational confidence under pressure.

Open Career Dashboard →

Keep going

Related & next steps

Was this helpful?

← All cookbook recipes