Ubuntu – AWS Large Instance: /mnt does not show all the space that should be available

amazon-web-serviceshostingUbuntu

I just created a Large (m1.large) 64 bit instance which comes with 850 GB instance storage. Look at the Large Instance http://aws.amazon.com/ec2/instance-types/

A 'df -h' from the root folder gives me the output below. The /mnt is where I'm thinking the instance storage is but here it is only showing me 414G. I have set up two servers and both are showing the same numbers.

 root@ip-11-11-11-11:/# df -h
 Filesystem            Size  Used Avail Use% Mounted on
 /dev/sda1             7.9G  1.1G  6.5G  14% /
 none                  3.7G  112K  3.7G   1% /dev
 none                  3.7G     0  3.7G   0% /dev/shm
 none                  3.7G   48K  3.7G   1% /var/run
 none                  3.7G     0  3.7G   0% /var/lock
 /dev/sdb              414G  199M  393G   1% /mnt

Best Answer

The instance-storage (i.e. ephemeral storage) is provided as two devices on the m1.large - /dev/sdb and /dev/sdc - each of approximately 420GB. Only one of these (/dev/sdb) is mounted (to the /mnt location). While the additional volume (/dev/sdc) is available, you will need to format it before mounting it.

See: http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/index.html?instance-storage-concepts.html for the specifics of how instance-storage is allocated by instance type.

m1.large: 850GiB instance storage (2 x 420GiB plus 10GiB root partition)

  • /dev/sda1: Formatted and mounted as root (/) on all Linux and UNIX instance types. types.
  • /dev/sdb or xvdb: Formatted and mounted as /mnt on m1.large, m1.xlarge, c1.xlarge, cc1.4xlarge, cc2.8xlarge, m2.xlarge, m2.2xlarge, and m2.4xlarge Linux and UNIX instances.
  • /dev/sdc or xvdc: Available on m1.large, m1.xlarge, cc1.4xlarge, cc2.8xlarge, and c1.xlarge Linux and UNIX instances.

Some AMIs may not provide the full ephemeral storage, however, you can add it when launching the instance by specifying the ephemeral disk mappings in your launch command:

ec2-run-instances <ami id> -k <your key> --block-device-mapping '/dev/sda2=ephemeral0' --block-device-mapping '/dev/sda3=ephemeral1' --block-device-mapping '/dev/sda4=ephemeral2' --block-device-mapping '/dev/sda5=ephemeral3'

Where ephemeral0 represents the root volume, ephemeral1 represents swap space, and ephemeral2+ represent the remaining available ephemeral storage as per the document above.