thenickdude / snap-to-s3

Upload EBS volume snapshots to Amazon S3/Glacier
Other
114 stars 24 forks source link

Question: #6

Closed jackbit closed 5 years ago

jackbit commented 5 years ago

Hi,

I am using --dd parameter, my question how to restore it back as snapshot ec2 instead file, because after executing line below, it will return insufficient space for /dev/xvdf, so i use another root volume /mnt/xvdf

aws s3 cp "s3://backups.example.com/vol-xxx/2017-01-01 snap-xxx.img.lz4" - | lz4 -d | sudo dd bs=1M of=/mnt/xvdf

But after extraction it returns file, how to make it mountable or back to snapshot ec2.

I have tried without --dd and after extracting to empty volume, then take snapshot on it and after that create image from snapshot, the image can not be started after lunched. The image keeps stoping. Please kindly help, thank you

thenickdude commented 5 years ago

You need to create an EBS volume of at least the same size as the original one to hold the restored data. The destination for dd should never be /mnt/xvdf, it needs to be the device name of the EBS drive to write to, probably /dev/xvdf (the drive must not be mounted!)

On Sat, 9 Mar 2019, 9:02 AM Yacobus Reinhart, notifications@github.com wrote:

Hi,

I am using --dd parameter, my question how to restore it back as snapshot ec2 instead file, because after executing line below, it will return insufficient space for /dev/xvdf, so i use another root volume /mnt/xvdf

aws s3 cp "s3://backups.example.com/vol-xxx/2017-01-01 snap-xxx.img.lz4" - | lz4 -d | sudo dd bs=1M of=/mnt/xvdf

But after extraction it returns file, how to make it mountable or back to snapshot ec2.

I have tried without --dd and after extracting to empty volume, then take snapshot on it and after that create image from snapshot, the image can not be started after lunched. The image keeps stoping. Please kindly help, thank you

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/thenickdude/snap-to-s3/issues/6, or mute the thread https://github.com/notifications/unsubscribe-auth/AB1Rgw9_fbIj_Q-4XBMs3hlRplAGIt5Iks5vUsG8gaJpZM4bmCNr .

jackbit commented 5 years ago

It worked. Backup without --dd makes the restore does not working. So if you have ami, instance, or snapshot and you want to upload on S3 and restore again successfully, here is steps:

  1. Backup the instance snapshot

    snap-to-s3 --migrate --snapshots snap-xxxx --bucket bucket-name --validate --dd
  2. To restore (example, in new aws account or vpc ) :

  1. Create new AMI :