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

Running vim-airline with Maximum Awesome

I use [Maximum Awesome](https://github.com/square/maximum-awesome) when I code in [vim](http://www.vim.org/), it's a great starting place...… Continue reading

Quicksort implementation in Python

Published on August 04, 2014

Fibonacci generator in Python

Published on August 04, 2014