360 Secure SkillHub
360 安全技能中心

Linux Disk Doctor

面向 Linux 磁盘满/无剩余空间场景,提供排查与清理流程:用 df、du 定位占用,清理 apt 包缓存、旧内核、journal 日志、Docker 镜像与临时文件。内容以命令和简短说明为主,未给出文件系统扩容命令,也未说明备份或回滚方式。

laolaoqi
laolaoqi
热度 24.22
最近更新 2026-05-08 11:41:50
分类:自动化依赖:代码执行 / 读写文件应用场景:DevOps / 自动化脚本 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add linux-disk-doctor
Metadata
name
linux-disk-doctor
description
Diagnose and fix Linux disk full / no space issues. Find large files, clean logs, purge package caches, remove old kernels, handle Docker disk bloat, and expand filesystems. Use when df -h shows space critically low, applications fail with "no space left on device", or docker builds fail with ENOSPC.

Linux Disk Doctor

Free disk space fast.

Quick Assessment

df -h
du -sh /* 2>/dev/null | sort -rh | head -20

Cleanup Steps

# Package cache
apt-get clean && apt-get autoremove -y

# Old kernels (keep current)
dpkg --list | grep linux-image | awk '{print $2}' | grep -v $(uname -r) | xargs apt-get purge -y

# Journal logs
journalctl --vacuum-time=7d

# Docker
docker system prune -a -f

# Temp files
rm -rf /tmp/*

# Find largest directories
du -sh /var/log/* | sort -rh | head -10

📢 Need Help?

Need OpenClaw deployed on your server? I offer managed deployment & hosting: