This is what we did.
- Create a snapshot of the existing image you want to download in AWS.
- From that snapshot, create an image.
- Once the image is available, add that image as part of the EC2 Instance you wish to download.
- Create another image. Make sure this is bigger than the image that you want to backup. Basically this will hold the image backup
- Mount it as part of the EC2 Instance.
For this, this is what I have :
here,
- /dev/sda1 is the source or what I will backup
- /dev/sdf is a copy of /dev/sda1
- /dev/sdg will contain the backup.
To get the available mountpoints that can be mounted :
execute :
As you can see.. /dev/sdf (which is xvdf) is mounted as :
For /dev/sdg, the mountpoint is xvdg.
Since this is a new image, do the following commands :
Then mount (make sure that the folder /mnt/image is available)\:
Afterwards, create an image :
Once created, go to /mnt/image and do a tar/gz. This is to compress it.
After which, you can now do an SCP to the machine and download the file.