Convert an AWS instance-store AMI to an EBS backed AMI

January 16, 2014

Reading time ~1 minute

I recently needed to convert an AWS instance-store AMI to an EBS backed AMI. Here’s the steps I took in order to fix that. It’s a ext3 file system in this example, but it should work fine with an ext4 as well.

  1. Launch your instance-store AMI
  2. Create a new EBS in the same availability zone
  3. Attach the EBS to the instance-store instance on `/dev/sdh`
  4. Create the file system
    mkfs.ext3 /dev/sdh
  5. Mount the device
    mkdir /mnt/ebs
        mount /dev/sdh /mnt/ebs
  6. Shut down any running applications or databases that you have
  7. rsync your system to the EBS volume
    rsync -avHx / /mnt/ebs
        rsync -avHx /dev /mnt/ebs
  8. Label the device
    tune2fs -L '/' /dev/sdh
  9. Sync and unmount the device
    sync;sync;sync;sync && umount /mnt/ebs
  10. In the AWS Console, make a snapshot of the EBS drive
  11. Make a note of the AKI and ARI of the currently running instance (skip this if none are set)
  12. When the snapshot is complete, right click on it and choose "Create Image from Snapshot"
  13. Use the wizard to set an name and description of your new AMI. Also choose the right AKI etc.
  14. You should now be able to start a new instance from the newly created AMI.