Amazon EC2 and EBS disk space problem

前端 未结 7 2098
别跟我提以往
别跟我提以往 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 17:01

    Yes, the issue is simple. The volume is only associated with the instance, but not mounted.

    Check on the AWS console which drive it is mounted as - most likely /dev/sdf.

    Then (on ubuntu):

    sudo mkfs.ext3 /dev/sdf
    sudo mkdir /ebs
    sudo mount /dev/sdf /ebs
    

    The first line formats the volume - using the ext3 file system type. This is pretty standard -- but depending on your usage (e.g. app server, database server, ...) you could also select another one like ext4 or xfs.

    The second command creates a mount point and the third mounts it into it. This means that effectively, the new volume will be at /ebs. It should also show up in df now.

    Last but not least, maybe also add an entry to /etc/fstab to make it reboot-proof.

提交回复
热议问题