--- name: disk-pressure description: Диагностирует нехватку места или inode на Linux-сервере, оценивает объём возможной очистки и проверяет её результат по запросу. --- Use the [server-ops checkout](../server-ops/SKILL.md#select-the-checkout) for all repository paths and commands in this skill. ## Identify the constraint 1. Use [server-operate](../server-operate/SKILL.md#select-the-target) to resolve the target and connect. Use [server-healthcheck](../server-healthcheck/SKILL.md) for a broader host check. Diagnose with read-only commands. 2. Run `findmnt -T PATH`, `df -hP -- PATH`, and `df -iP -- PATH` for the affected path or its nearest existing parent. Record the mount, free blocks, and free inodes on the filesystem backing the service or data. 3. Start with likely directories on that filesystem. Use a time-bounded scan such as `timeout 30s du -x -h --max-depth=1 -- DIR`. For inode pressure, use `timeout 30s du -x --inodes --max-depth=1 -- DIR`. Repeat where the results warrant it. Treat a timeout or permission error as partial evidence. 4. Compare `du` with usage on the same mount. Account for other directories on that mount. If a gap remains, look for open unlinked files with `lsof -nP +aL1 MOUNT` where available and identify the owning service. Consider filesystem metadata, reserved blocks, or snapshots as applicable. ## Estimate and reclaim space - Compare candidates by size, owner, active use, and retention. For systemd journals, check `journalctl --disk-usage` and where the journals reside. For backups, check which recovery points the retention policy protects. - For Docker, check the context endpoint and applicable `DOCKER_CONTEXT` and `DOCKER_HOST` overrides locally before contacting the daemon. Use the intended engine and start with `docker system df`. Use `-v` for per-object detail when needed. Account for shared layers and treat reclaimable space as an estimate. Check bind-mounted data and container logs on their backing filesystem when relevant. - If cleanup is requested, recheck the candidate's path or object, active references, and retention before removal. Use the owning service or runtime's targeted operation and keep it within the requested scope. Preserve persistent data and required recovery points unless the request explicitly covers their removal. For a large open unlinked file, choose the owning service's supported reopen, reload, or restart when authorized. Verify that the process released the file. - Rerun the same block and inode checks. Verify affected services after cleanup and [record the result](../server-operate/SKILL.md#record-the-result) with the before and after values, changes, and remaining gaps.