Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon EC2 and EBS disk space problem

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

like image 639
Simon Avatar asked Oct 14 '10 12:10

Simon


People also ask

What is the maximum storage capacity for the drive in EBS?

EBS currently supports a maximum volume size of 64 TiB. This means that you can create an EBS volume as large as 64 TiB, but whether the OS recognizes all of that capacity depends on its own design characteristics and on how the volume is partitioned.

How do I check my EBS volume space?

Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/ . In the navigation pane, choose Instances. Select the instance. In the Description tab, for Block devices, select the block device mapping and then choose the EBS ID to view additional details for the volume.


2 Answers

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.

like image 106
Till Avatar answered Sep 17 '22 19:09

Till


Perhaps the original 15 GB Volume was cloned into a 50 GB volume but then not resized?

Please see this tutorial on how to clone and resize: How to increase disk space on existing AWS EC2 Linux (Ubuntu) Instance without losing data

Hope that helps.

like image 38
AWS Fan Avatar answered Sep 21 '22 19:09

AWS Fan