简体   繁体   English

xvda1 是否占用了我在 ec2 上的所有磁盘空间

[英]Is xvda1 taking up all my disk space on ec2

When I log into my ec2 ubuntu instance, I can not download files.当我登录到我的 ec2 ubuntu 实例时,我无法下载文件。 I see this error我看到这个错误

OSError: No space left on device

When I run this当我运行这个

(python3) ubuntu@ip-172-30-1-208:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev             30G     0   30G   0% /dev
tmpfs           6.0G  8.9M  6.0G   1% /run
/dev/xvda1       93G   93G     0 100% /
tmpfs            30G     0   30G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            30G     0   30G   0% /sys/fs/cgroup
/dev/loop0       92M   92M     0 100% /snap/core/8689
/dev/loop1       90M   90M     0 100% /snap/core/8039
/dev/loop2       18M   18M     0 100% /snap/amazon-ssm-agent/1480
/dev/loop4       18M   18M     0 100% /snap/amazon-ssm-agent/1566
tmpfs           6.0G   24K  6.0G   1% /run/user/1000

It looks like all my hard disk, 93G is taken up by xvda1 .看起来我所有的硬盘,93G 都被xvda1占用了。 Am I reading this right?我读对了吗?

The root file system is full根文件系统已满

Usually, this happens on servers when the logging goes awry通常,当日志记录出错时,这会发生在服务器上

My tip is, log in, become root and then cd /var/log and run du -smc *我的建议是,登录,成为 root,然后cd /var/log并运行du -smc *

This may well take a while but will show you where the big logs are这可能需要一段时间,但会告诉你大日志在哪里

Note that deleting an in-use logfile will not usually free up disk space请注意,删除正在使用的日志文件通常不会释放磁盘空间

This happened because root is full.发生这种情况是因为 root 已满。

You can find which files are using more space by using the following command.您可以使用以下命令查找哪些文件正在使用更多空间。

sudo find / -type f -size +10M -exec ls -lh {} \;

After that delete large files using rm command之后使用 rm 命令删除大文件

rm -f <path-to-large-file>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM