Amazon 上的 EC2 实例,我收到“磁盘上没有剩余空间"的提示. [英] EC2 instance on Amazon and I am greeted with "No space left on the disk"

查看:24
本文介绍了Amazon 上的 EC2 实例,我收到“磁盘上没有剩余空间"的提示.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了 Amazon EC2 fedora 实例并将文件从一个位置复制到另一个位置.但是我收到了磁盘上没有剩余空间"的消息.

I have installed Amazon EC2 fedora instance and copying the files from one location to another. But I am greeted with " No space left on the disk".

我做了df -f.

带输出:

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              15G   15G     0 100% /
none                  312M     0  312M   0% /dev/shm

我想增加亚马逊上 ec2 实例的空间.有人可以帮我吗?

I want to increase the space for ec2 instance on amazon. Can someone help me with it?

推荐答案

我有一个解决方案,伙计们 yippeeee

I got a solution guys yippeeee

假设您使用的是 linux AMI,在您的情况下,您有一个简单的方法来增加文件系统的大小:

Assuming that you are using a linux AMI, in your case you have an easy method for increasing the size of the file system:

1) 停止实例

2) 分离根卷

3) 对卷进行快照

4) 使用新大小从快照创建一个新卷

4) Create a new volume from the snapshot using the new size

5) 将新卷附加到原始卷所在位置的实例

5) Attach the new volume to the instance on the same place where the original one was

6) 启动实例,停止除 ssh 之外的所有服务,并将根文件系统设置为只读

6) Start the instance, stop all services except ssh and set the root filesystem read only

7) 如果需要,扩大文件系统(例如使用 resize2fs)和/或分区

7) Enlarge the filesystem (using for example resize2fs) and or the partition if needed

8) 重启

作为替代方案,您还可以启动一个新实例并映射实例存储,或者您可以结合前两个步骤创建一个新的 ami.

As an alternative you can also launch a new instance and map the instance storage or you can create a new ami combining the two previous steps.

这篇关于Amazon 上的 EC2 实例,我收到“磁盘上没有剩余空间"的提示.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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