How do I restore an EBS volume that's attached to an EC2 instance from an EBS snapshot?

2 minute read
0

I want to restore an Amazon Elastic Block Store (Amazon EBS) volume that's attached to an Amazon Elastic Compute Cloud (Amazon EC2) instance from an EBS snapshot.

Resolution

Use one of the following ways to restore the EBS volume from an EBS snapshot.

Restore the EBS snapshot to an EBS volume

To restore data from an EBS snapshot, you can create a new EBS volume from the EBS snapshot. The new EBS volume has the data of the EBS snapshot from the time that the snapshot was first created.

Attach the EBS volume to an existing EC2 instance, mount the volume inside the EC2 instance, and then read or copy the data.

Restore the root volume of an EC2 instance from an EBS snapshot

You can't restore an EBS snapshot on to an existing EBS volume. Instead, create a new EBS volume. Then, replace the old root volume of the EC2 instance with the new EBS volume.

To replace the root volume of the EC2 instance, complete the following steps:

  1. Stop your EC2 instance.
  2. Detach the old root volume from your EC2 instance.
  3. Note device name that the root volume is attached as, for example /dev/xvda.
  4. Use the same device name to attach the new root volume to your EC2 instance.
  5. Start your EC2 instance.

Or, to restore the instance's root volume to a specific snapshot that you created from the root volume, replace the root volume.

Create an AMI from an EBS snapshot, and then launch a new EC2 instance from the AMI

To create an Amazon Machine Image (AMI) from an EBS snapshot, complete the following steps:

Note: The AMI becomes the root volume for your new EC2 instance.

  1. Open the Amazon EC2 console.
  2. On the Elastic Block Store menu, choose Snapshots.
  3. Select the EBS snapshot.
  4. Choose Actions, and then from Snapshots, choose Create Image.
  5. Enter a name for your image, and then choose the options for the image.

After you create the image, make sure that it's available. Then, launch a new EC2 instance that uses the EBS snapshot for the root volume.

AWS OFFICIAL
AWS OFFICIALUpdated 4 months ago