在Amazon EC2实例和我打招呼[否剩余空间的磁盘&QUOT上;和我、磁盘、剩余、实例

2023-09-11 08:42:43 作者:咬一口奶油

我已经安装了亚马逊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

我想增加对Amazon EC2实例的空间。有人可以帮助我呢? 感谢您的帮助。

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

推荐答案

我有一个解决方案家伙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两者结合previous步骤。

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.