如何在 Linux CentOS 系统上清理主系统驱动器上的空间? [英] How do I clear space on my main system drive on a Linux CentOS system?

查看:19
本文介绍了如何在 Linux CentOS 系统上清理主系统驱动器上的空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对不起,如果这听起来很愚蠢,但我不知道该怎么做.

Sorry if this sounds dumb, but I'm not sure what to do.

我有一个带有完全完整的临时驱动器(包含所有系统文件的主驱动器)的 Amazon EC2 实例.我安装了 Apache、MySQL、Sphinx、我的应用程序等的几乎所有目录都位于单独的物理驱动器上,并且具有来自临时驱动器的符号链接.据我所知,他们的数据或日志都没有写入临时驱动器,所以我不确定空间发生了什么.

I've got an Amazon EC2 instance with a completely full Ephemeral drive ( the main drive with all the system files ). Almost all the directories where I've installed things like Apache, MySQL, Sphinx, my applications, etc. are on a separate physical drive and have symlinks from the ephemeral drive. As far as I am aware, none of thier data or logs write to the ephemeral drive, so I'm not sure what happened to the space.

显然很多系统内容仍在临时驱动器上,但我不确定如何清除这些内容以腾出空间.我最好的猜测是亚马逊在对系统进行一些自动更新时填充了驱动器.我正在尝试安装一些新包,并通过 YUM 更新我所有的系统包,但驱动器没有空间.

Obviously lots of system stuff is still on the ephemeral drive, but I'm not sure how to clear things off to make space. My best guess is that amazon filled the drive when it did some auto updates to the system. I'm trying to install some new packages, and update all my system packages via YUM, but the drive has no space.

我该怎么办?

推荐答案

这很好用.在更大的驱动器(超过几百 GB)上可能需要几分钟:

This works great. Can take a few minutes on bigger drives ( over a few hundred GB ):

find /directory/to/scan/ -type f -exec du -a {} + | sort -n -r | less

输出将首先是最大的文件.您可以使用普通的less"命令对结果进行翻页...空格键(下一页)和 b(上一页).

The output will be the biggest files first. You can page through the results with normal "less" commands ... space bar ( next page ) and b ( previous page ).

这篇关于如何在 Linux CentOS 系统上清理主系统驱动器上的空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆