user1965449
user1965449

Reputation: 2931

When I stop and start an ec2 cents os instance , what data do I loose

I have an ec2 instance that is hosting a CentOS AMI image and the root device is EBS , however it is not EBS optimized.

I have installed a few packages on it now I want to stop and start it again , Amazon documentation says that the EBS data would be available but the instance store data would be lost.

How do I know where(EBS or Instance store) my packages are stored ? I see that package files are in /opr /var /etc directories .

Will I loose my installed packages if I stop and start the Amazon ec2 instance ?

enter image description here

Thanks.

Upvotes: 0

Views: 2033

Answers (2)

Rico
Rico

Reputation: 61521

When you create an EBS backed instance (with ephemeral or instance store storage, and it doesn't matter whether it's optimized or not optimized) you don't lose data in your /opt or /var or /etc directory or any of the system data. So you are safe to stop and then restart it. Keep in mind that your internal and public IP addresses change once you restart it.

The only data that you lose is if you have ephemeral volumes which are generally mounted volumes with devices like /dev/sdb, /dev/xvdb, /dev/xvdc, etc.

If you create an instance store "only" instance then you lose everything. However, you will be able to tell if your instance is this type by not having the option to "stop" it. Meaning you can only terminate it. These are the first type of instances that EC2 offered when they started and maybe up until 3-4 years ago were the only ones, so they are not used that much AFAIK unless you need an ephemeral volume as your root volume.

[Edit]

This is what it's supposed to look like for an EBS backed instance (non-optimized):

EBS Backed instance

Upvotes: 4

StuartB
StuartB

Reputation: 96

You will not lose your data if the instance is setup as EBS.

EBS optimised is another option which adds additional IOPS, useful for busy database applications, etc.

Upvotes: 1

Related Questions