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

查看:66
本文介绍了如何在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

输出将首先是最大的文件.您可以使用普通的较少"命令翻页结果...空格键(下一页)和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天全站免登陆