Amazon EC2 and EBS disk space problem

前端 未结 7 2074
别跟我提以往
别跟我提以往 2021-02-02 16:29

I am having a problem reconciling the space available on my EBS volume. According to the AWS console the volume is 50GB and is attached to an instance.

If I ssh to this

7条回答
  •  孤街浪徒
    2021-02-02 16:55

    Here is the simple way...

    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) Stop the instance 2) Detach the root volume 3) Snapshot the volume 4) Create a new volume from the snapshot using the new size 5) Attach the new volume to the instance on the same place where the original one was 6) Start the instance, stop all services except ssh and set the root filesystem read only 7) Enlarge the filesystem (using for example resize2fs) and or the partition if needed 8) Reboot

    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.

提交回复
热议问题