SafeDisk AI

Full Disk Trash GC Deadlock Recovery

Some stateful services enter a nasty loop when the disk is full: the trash or async deleter is the component that should free space, but it crashes during startup because the filesystem cannot create, list, or write its own recovery directory. Treat that as a storage deadlock, not a normal cache cleanup.

Ask free AI judgment

Find what you can delete.

Leave your email now. The scan summary can follow after the first reply; we send the free SafeDisk AI deletion trial step only if deletion risk is still unclear.

Add command output optional

Free trial step. We reply first with a delete / confirm / protect judgment or one read-only detail we still need.

See sample result Ask AI about one file

Runbook: Break The Self-Reinforcing Loop

  1. Preserve the first error. A later "directory missing" or "file not found" may only be a consequence of an earlier ENOSPC during mkdir, write, rename, or fsync.
  2. Measure both bytes and inodes on the mounted data root. A full inode table can make cleanup code fail even when bytes look available.
  3. Find the trash, deleted, pending-delete, GC, WAL, snapshot, and temp path families separately. Do not mix reclaimable trash with active tenant or database state.
  4. If the cleanup worker is supervised, make boot tolerant: list with an error return, report the true reason, and keep retrying instead of taking the whole stack down.
  5. Add a low-space admission check before enqueueing new deletes or snapshots. The system should stop creating more trash before the trash worker loses the ability to run.
  6. Turn the incident into a guard: minimum free bytes/inodes, max pending trash age/size, oldest cleanup success timestamp, and an emergency owner-approved purge path.
Copy-ready issue reply

Use this when the deleter cannot start on a full disk.

This keeps the thread focused on the actual recovery invariant: make cleanup boot resilient, expose the real ENOSPC, and define safe trash boundaries.

I would treat this as a full-disk cleanup deadlock, not just a missing-directory bug: the component responsible for reclaiming trash has a startup path that itself needs writable/listable storage.

The useful split is:

1. Preserve the real first error. If mkdir/write failed with ENOSPC, do not let a later File.ls/list-dir ENOENT become the surfaced cause.
2. Make the cleanup worker boot resilient on full-disk conditions. Use non-bang list calls, log the true reason, and keep a retry loop alive instead of failing the stack supervisor.
3. Add an admission guard before creating more trash: minimum free bytes/inodes, max pending trash age/size, and last successful delete timestamp.
4. For recovery, capture read-only evidence first:

df -h <data-root>
df -i <data-root>
find <data-root> -maxdepth 4 -type d \( -name "*trash*" -o -name "*deleted*" -o -name "*gc*" \) -print
du -xh <data-root> 2>/dev/null | sort -h | tail -80

Only after that would I define which trash paths are owner-approved for emergency purge versus state that needs product-specific recovery rules.

Do Not Delete First

Free AI deletion trial

Need a delete / confirm / protect answer?

Send the issue link, log excerpt, or storage summary first. We reply with the next safe move and offer the free SafeDisk AI deletion trial only if the incident still needs review.

Add output optional

Start with email. Output can follow after the first reply.