Steps to shrink an AWS ECS EBS volume

Could you please try the following method to shrink your EBS volume:

1) Create a volume from your snapshot with the original volume size.
2) Create a new volume in the same Availability zone as the volume you just created above but use a size of 10GB.
3) Launch a new instance in the same availability zone as the volumes (do not add volumes etc to the instance).
4) Attach both volumes to the instance. Attach your large volume on /dev/sdf and the 10GB volume on /dev/sdg
5) SSH into the instance and make a file system on the new volume 'sudo mkfs.ext3 /dev/xvdg'
6) Mount both volumes: 'sudo mkdir /mnt/old | sudo mount /dev/xvdf /mnt/old' and 'sudo mkdir /mnt/new | sudo mount /dev/xvdg /mnt/new'
7) Use rsync to copy the volumes: 'rsync -aHAXxSP /mnt/old /mnt/new'
8) Unmount the volumes 'sudo umount /dev/xvdf | sudo umount /dev/xvdg'
9) Stop the instance
10) Detach all the volumes from the instance including the root volume.
11) Attach the 10GB volume to the instance on /dev/sda1
12) Start the instance and verify the volume side using 'df -h'
13) Take an AMI of this instance.

Comments

Popular posts from this blog

Push command for NetWorker Client Upgrade

Factors Affecting Users’ Sense of Security and Trust in Integrating Electronic health record to the cloud

Basic Elastic Cloud Storage Troubleshooting Commands