Dinesh
Dinesh

Reputation: 4561

how to clone an Amazon EBS volume into another one of smaller size

I have two amazon ec2 instances, (1) using SLES and running my current site, and (2) a new one using Amazon Linux. I am simply trying to move my site from the SLES and then retire it.

I have a 100GB EBS volume attached to the SLES server of which only about 20GB is actually used. What's the best way to bring the data over to the new instance?

Thanks a lot

Upvotes: 1

Views: 4343

Answers (1)

Brandon Nicoll
Brandon Nicoll

Reputation: 444

It is easy to increase the size of a target volume, but the only way you're going to be able to make it smaller is to create a blank volume of the size you want. Then, either mount the new one to the old instance and do a copy or detach the old volume and reattach it to the new and do a copy. Basically, of the options you listed, only the first and second ones would work. The reason making a snapshot won't work is because creating a snapshot from a volume makes the snapshot the same size as the volume it was created from. You would get an error trying to create a volume from snapshot that is smaller than the original.

Upvotes: 2

Related Questions