Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an Amazon EC2 instance that is running a simple LAMP stack with Amazon's flavor of linux. I want to stop it and add more disk space. We will need more than our current 8 gigabytes.

I was wondering:

  1. When I stop my instance what will be lost? Will the content of /var/www be lost? What does this mean? I am sure my instance isn't a spot instance.

    1. What is an ephemeral disk? Is my instance completely ephemeral? Are parts of it ephemeral? When I press "stop", probably, not everything is cleared. So what is cleared?
  2. Amazon has tools in the Management Console to facilitate enlarging an instance?

  3. Will I have to re-partition the instance? Can an instance expand the partition it is running on?

share|improve this question
    
What AMI id did you use to start the instance? in what region are you running the instance? –  Eric Hammond Nov 22 '11 at 1:29

3 Answers 3

up vote 4 down vote accepted

Since your instance currently has 8 GB on the root disk, it is probably an EBS boot instance. This means that your file system will be kept intact through a "stop"/"start" cycle, but you will (by default) lose everything if you "terminate" the instance.

Here's an article I wrote that describes what happens when you stop/start an instance (and when you simply reboot):

Rebooting vs. Stop/Start of Amazon EC2 Instance
http://alestic.com/2011/09/ec2-reboot-stop-start

Here's an article I wrote that describes how to increase the size of your EBS root volume:

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

These articles should answer most of the questions your list.

share|improve this answer
    
Thats what I ended up going with. I was just terrified into posting for help when I noticed the warning about "ephemeral" storage despite not having any. Better be safe then sorry. –  Mikhail Nov 23 '11 at 9:42

1) When I stop my instance what will be lost? Will the content of /var/www be lost? What does this mean? I am sure my instance isn't a spot instance. What is an ephemeral disk? Is my instance completely ephemeral? Are parts of it ephemeral? When I press "stop", probably, not everything is cleared. So what is cleared?

Only specially mounted storage is lost. It appears that this storage is not mounted by default, although Amazon's tools produce a warning about ephemeral storage independent of its utilization.

2) Amazon has tools in the Management Console to facilitate enlarging an instance?

Yes

3) Will I have to re-partition the instance? Can an instance expand the partition it is running on? resize2fs handle's the resize.

share|improve this answer

Your data (both software and files) should be stored on an EBS volume (unless you have specific requirements that favour an ephemeral volume).

If the above is true (i.e. you have an EBS root volume), it is easy enough to add more space.

1) When I stop my instance what will be lost? Will the content of /var/www be lost? What does this mean? I am sure my instance isn't a spot instance.

When you stop your instance, you will lose:

  • All data on ephemeral disks
  • The IP addresses of the instance (except for an Elastic IP)

Spot instances cannot be stopped (only terminated)

2) Amazon does NOT have tools that directly allow for resizing a volume, but this can be accomplished using the available tools, in conjunction with some command on the server. Essentially:

  • Take a snapshot of the EBS volume
  • Create a new (larger) volume from the snapshot
  • Attach the new volume to an instance and resize the filesytem (i.e. resize2fs for ext4)
  • Detach the original root volume from your original instance, and attach the new volume

3) As mentioned above, the 'partition' size is limited by the size of the EBS volume. It is pointless to create an EBS volume larger than the size of the partitions it contains (as you pay for allocated space, not used space). It may be advisable to move all your data off the root volume. Create and attach a second EBS volume to the instance instead of making the root volume larger. In addition to separating the system software and your data, this reduces the data included in snapshots, and should make any future changes to your disk size easier.

share|improve this answer
    
Well my data isn't stored in an EBS volume. I am not quite sure of the need. We only run one instances that runs a humble LAMPS stack. –  Mikhail Nov 21 '11 at 8:08
1  
If your instance crashes with an ephemeral root, all your data (software configurations, databases, files, etc) will be lost. Are you certain you are using an ephemeral root? Amazon's Linux instances use an EBS root by default. Check your EBS volumes (in the EC2 console) while the instance is running - there should be an 8GB EBS volume attached to the instance. Non-EBS root volumes are limited to 10GB, and I don't believe the normal commands (modify-attributes, etc) will allow you to change its size, requiring you to rebundle the image. –  cyberx86 Nov 21 '11 at 9:31
    
To answer your question of what is ephemeral storage: for the root device it is S3 backed (i.e. the AMI is stored on S3, and loaded to temporary storage) - there are many AMIs (including some of Amazon's Linux) that have ephemeral roots. Each instance (other than t1.micro's) also has additional ephemeral storage available to it, that can be found at /dev/sda2, /dev/sd[b-e], although it may not be mounted by default. –  cyberx86 Nov 21 '11 at 12:23
1  
It is fine to increase the size of the root EBS volume < alestic.com/2010/02/ec2-resize-running-ebs-root >. The root EBS volume will be partitionless for most public AMIs, so there's no need to repartition. I do generally recommend that data be stored in a separate EBS volume, if possible. –  Eric Hammond Nov 22 '11 at 1:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.