Amazon EC2 and EBS disk space problem

Viewed 18931

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 instance and do a df -h, I get the following output:

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1              15G   13G  3.0G  81% /
udev                  858M   76K  858M   1% /dev
none                  858M     0  858M   0% /dev/shm
none                  858M   72K  858M   1% /var/run
none                  858M     0  858M   0% /var/lock
none                  858M     0  858M   0% /lib/init/rw

I am pretty new to AWS. I interpret this as "there is a device attached and it has 15GB capacity. Whats more, you're nearly out of space!"

Can anyone point out the cause of the apparent discrepancy between the space advertised in the console and what is displayed on the instance?

Many thanks in advance

S

8 Answers

It is because, "After you increase the size of an EBS volume, you must use file system–specific commands to extend the file system to the larger size. You can resize the file system as soon as the volume enters the optimizing state.", without bouncing an instance.

I was just facing the same issue today, I was able to resolve it,

  1. Figure out the type of your file system, $ cat /etc/fstab

  2. Follow this AWS doc, that precisely documents the steps to extend the linux Partition/FS after resizing a volume of a EC2 instance.

    Extending a Linux File System After Resizing a Volume

On Ubuntu, for Extend the Filesystem.

To find block device:

blkid

In my case type is TYPE="ext4".

To resize the disk volume:

sudo resize2fs /dev/xvdf
Related