Verify an EBS Restore with AWS Backup

Verify an EBS Restore with AWS Backup

A completed AWS Backup job proves that a resource was created. A restore drill should also prove that the recovered data is readable and meets the workload’s recovery objectives. For Amazon EBS, restore one data volume to an isolated instance, verify a known file, and record the result before deleting the lab volume.

Prepare an isolated restore target

  • Use a sandbox account, AWS CLI v2, an existing AWS Backup recovery point for an encrypted EBS data volume, and an isolated Linux verifier instance in the same Region. This guide uses a regular ext4 data partition.
  • Choose the verifier’s Availability Zone as the destination for the restored volume. EBS volume attachments require the volume and instance to be in the same zone.
  • Record the recovery point creation time, expected SHA-256 checksum for a known file at backup time, and the time you start the drill. Use synthetic data when creating the recovery point for a lab.
  • Confirm the AWS Backup restore role has the needed permissions and KMS access. The operator also needs permission to pass the role and inspect, attach, detach, and delete the lab volume.

Restore to a new EBS volume

In the AWS Backup console, select the vault and EBS recovery point, then choose Restore. Choose a new EBS volume, the isolated instance’s Availability Zone, and an approved encryption key. Pick the volume type and size that suit the drill. When the job starts, copy its restore job ID for the next command. Keep the source volume untouched. AWS Backup guide for EBS restores.

Check job status and identify the new volume

Set the Region and replace the job ID. Verify that the status is COMPLETED and that Resource identifies a new EBS volume. Record the completion time, then check the volume ID and Availability Zone in EC2 before attaching anything.

REGION=us-east-1
JOB_ID="replace-with-restore-job-id"

aws backup describe-restore-job --region "$REGION" --restore-job-id "$JOB_ID" \
  --query '{Status:Status,Detail:StatusMessage,Started:CreationDate,Finished:CompletionDate,Resource:CreatedResourceArn}'

VOLUME_ID="replace-with-restored-vol-id"

aws ec2 describe-volumes --region "$REGION" --volume-ids "$VOLUME_ID" \
  --query 'Volumes[0].{Id:VolumeId,Zone:AvailabilityZone,State:State,Encrypted:Encrypted}'

If the job is still running, wait and check it again. If it fails, use StatusMessage to guide your investigation. Recoveries from an archive tier can take longer than those from warm storage. Restore job status and fields.

Validate the recovered filesystem

Attach the confirmed new volume to the isolated instance in EC2. Inside the instance, use lsblk to identify the new disk and filesystem by size and device information. On Nitro-based instances, an EBS device can appear with an NVMe name that differs from the requested attachment name. Check the volume identity before choosing a device.

lsblk -o NAME,SIZE,FSTYPE,SERIAL,MOUNTPOINTS

# Replace this with the exact ext4 partition on the restored volume.
DEVICE=/dev/nvme1n1p1
sudo mkdir -p /mnt/techmandra-restore
sudo mount -t ext4 -o ro,noload "$DEVICE" /mnt/techmandra-restore
sudo sha256sum /mnt/techmandra-restore/drill/known-good.txt
sudo umount /mnt/techmandra-restore

Use the mount options appropriate for the actual filesystem. For this ext4 example, a read-only mount with noload avoids replaying the journal. Compare the checksum with the value you recorded and check any application-level invariants your workload requires. Record total time to verified data separately from the service’s job completion time. Map an NVMe device to its EBS volume.

Troubleshoot and clean up

  • Attachment fails. Compare the verifier instance and restored volume Availability Zones.
  • The restore role gets AccessDenied. Check the restore role, KMS key policy, and operator’s ability to pass the role.
  • The file is missing or the checksum differs. Verify the recovery point timestamp, device selection, and path. For an application writing data across volumes, add a workload-level consistency check before accepting the drill.

After unmounting, detach the temporary volume, wait for it to become available, and delete only that restored volume. Normal EBS charges apply while it exists. Keep the source recovery point under its existing retention policy. Amazon EBS pricing.

Related reading

Techmandra Avatar

Leave a Reply

Your email address will not be published. Required fields are marked *