2

I had a 8GB EBS attached to my EC2 Instance
but I was running out of space
what I did on the AWS Management Console:

  1. Create a snapshot of the current EBS (8GB)
  2. Create a new EBS based on the snapshot (200 GB)
  3. Stop the EC2 Instance
  4. Detach current EBS (8GB)
  5. Attach new EBS (200GB)
  6. Start the EC2 Instance
  7. Assign the Elastic IP

the problem:
When i hit df -h / I get:

Filesystem            Size  Used Avail Use% Mounted on
/dev/xvda1            7.9G  6.0G  1.6G  80% /

and there's a partition mounted on /mnt with 414GB I really don't know where did those 414GB came from :S.

df -h /mnt

Filesystem            Size  Used Avail Use% Mounted on
/dev/xvdb             414G  199M  393G   1% /mnt

...now where are my 200GB of my new EBS ? is there any step i missed on the AWS Management Console? how can i get the root partition (/) to use a larger space than 8GB

Mr_Nizzle
  • 133
  • 5
  • 1
    When you say "stop the AMI" and "start the AMI" you really mean that you stopped and started the "instance". An AMI is the image that is used to run the instance in the first place, but once the instance is running, the AMI is somewhat irrelevant. – Eric Hammond Sep 28 '11 at 01:05
  • 1
    In order to get a slightly cleaner snapshot (less risk of file system corruption) the proper time to take the snapshot is while the instance is stopped. – Eric Hammond Sep 28 '11 at 01:05
  • Just fixed that text and changed from AMI to EC2 Instance, thanks for the advices. – Mr_Nizzle Sep 28 '11 at 15:05

1 Answers1

3

The extra space on /mnt is ephemeral storage. Anything put there will disappear when your instance is stopped or terminated or fails.

The full 200GB on your root EBS volume are probably there, but you need to tell the file system to use all of it.

If you are using ext3 or similar (likely) try a command like:

sudo resize2fs /dev/xvda1

If you are using XFS (less likely) try:

sudo apt-get update && 
sudo apt-get install -y xfsprogs
sudo xfs_growfs /

I wrote an article about this process of resizing the root EBS volume on my tech blog:

Resizing the Root Disk on a Running EBS Boot EC2 Instance
http://alestic.com/2010/02/ec2-resize-running-ebs-root

Minor point: You are (probably) not using any actual "partitions" on your EBS volume. The most common usage of EBS volumes is to place the file system on the raw block device without partitioning it. If you did have partitions, you'd first need to extend them before growing the file system.

Eric Hammond
  • 11,163
  • 1
  • 36
  • 56
  • Done and Done man ! Thanks now ... about those 414GB on `/mnt` will amazon will charge that extra space for me ? or that space does not count for me? – Mr_Nizzle Sep 28 '11 at 15:04
  • 1
    Ephemeral storage is free and there's no charge for the IO. – Eric Hammond Sep 28 '11 at 17:07
  • Hi Eric, I'm getting stuck on the first hurdle to accessing the ephemeral storage. Any help greatly appreciated... http://askubuntu.com/questions/148175/cant-access-ephemeral-storage-on-amazon-ubuntu-instance – matt burns Jun 08 '12 at 14:29