agentleFS
selamy-labsselamy-labs/agent-skills/skills/disk-pressure-forensics/SKILL.md

disk-pressure-forensics

Skill0 starsChanged 5 days agoMITView on GitHub

Use when disk usage is high, df and du disagree, or an agent must diagnose full filesystems without deleting valuable work.

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 9 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this when a filesystem is full, nearly full, or df reports usage that normal du output does not explain.

    line 8
  2. Distinctive:

    Check deleted but still open files:

    line 26
  3. Distinctive:

    use size-based vacuuming instead of deleting journal files by hand.

    line 32
  4. Distinctive:

    Look for un-reaped workspaces:

    line 33
  5. Distinctive:

    Check permission blind spots:

    line 36
  6. Very specific:

    When Kubernetes reports DiskPressure=True:

    line 48
  7. Distinctive:

    Check the node condition and kubelet summary first:

    line 50
  8. Distinctive:

    If GitOps controllers are down because of disk pressure, merge the desired source change first, then use a short controller-gap bridge that …

    line 57
  9. Distinctive:

    Stop recurring CronJobs that pull large images before trying deeper cleanup.

    line 60
  10. Distinctive:

    Prefer deleting caches, build outputs, and clearly abandoned temp work.

    line 65
  11. Distinctive:

    Do not delete live worktrees, state directories, credentials, or logs needed for incident reconstruction without an explicit owner decision.

    line 66
  12. Very specific:

    delete terminal Failed / Succeeded pods when their logs have been captured

    line 72
  13. Very specific:

    use crictl rmi --prune for unused images

    line 74

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Disk Pressure Forensics

Use this when a filesystem is full, nearly full, or df reports usage that normal du output does not explain.

First Principles

  • df measures allocated blocks on the filesystem.
  • du measures visible directory entries from the current permissions view.
  • A large df versus du gap usually means deleted-open files, inaccessible paths, mounts, snapshots, or accounting outside the user's view.

Diagnostic Order

  1. Confirm the filesystem and mount:
    • df -h
    • findmnt
  2. Measure visible usage from a privileged view when available:
    • du -xhd1 <mount>
    • repeat inside the largest directories
  3. Check deleted but still open files:
    • lsof +L1
    • restart or stop only the specific process that owns the deleted file if the service impact is acceptable.
  4. Check journal growth:
    • journalctl --disk-usage
    • use size-based vacuuming instead of deleting journal files by hand.
  5. Look for un-reaped workspaces:
    • old clones, worktrees, virtual environments, package caches, build outputs, test artifacts, and temporary archives.
  6. Check permission blind spots:
    • root-owned directories can make unprivileged du under-report.
    • suppressed errors can turn a permission problem into a false "empty" result.

Kubernetes Local-Path Trap

On single-node k3s or similar clusters, local-path PersistentVolumes, container images, writable overlay layers, pod logs, and kubelet eviction accounting can all share the node root filesystem. A pod may report its mounted state path as "full" even when its PVC request looks large enough, because the PVC is just a directory on the same root disk.

When Kubernetes reports DiskPressure=True:

  • Check the node condition and kubelet summary first:
    • kubectl describe node <node>
    • kubectl get --raw /api/v1/nodes/<node>/proxy/stats/summary
  • Separate imageFs from local-path PVC usage:
    • containerd image/snapshot data is usually under /var/lib/rancher/k3s/agent/containerd
    • local-path PVC data is usually under /var/lib/rancher/k3s/storage
  • If GitOps controllers are down because of disk pressure, merge the desired source change first, then use a short controller-gap bridge that applies the same declared manifest. Record it as bridge work, not a new source of truth.
  • Stop recurring CronJobs that pull large images before trying deeper cleanup; a failed image pull can consume the last free blocks repeatedly.

Cleanup Rules

  • Prefer deleting caches, build outputs, and clearly abandoned temp work.
  • Do not delete live worktrees, state directories, credentials, or logs needed for incident reconstruction without an explicit owner decision.
  • For recurring pressure, codify cleanup as a timer or job with an allowlist and a dry-run mode.
  • In Kubernetes incidents, prefer service-native cleanup before manual host deletion:
    • delete terminal Failed / Succeeded pods when their logs have been captured
    • use crictl rmi --prune for unused images
    • prune only allowlisted rebuildable cache paths such as .cache, .npm, tmp, or language-server caches; do not prune databases, sessions, credentials, queues, or archives unless they have an owner-approved backup

Done

  • You can explain the df usage with concrete evidence.
  • Any cleanup target is identified by path, age, owner, and reason.
  • Recurrence has either a declared guard or a recorded follow-up.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.