Skip to content

Instantly share code, notes, and snippets.

@hostmaster
Created September 8, 2015 16:14
Show Gist options
  • Save hostmaster/2b9f5154702aee81197b to your computer and use it in GitHub Desktop.
Save hostmaster/2b9f5154702aee81197b to your computer and use it in GitHub Desktop.
aws resize root volume
aws ec2 stop-instances --instance-ids i-ID
aws ec2 detach-volume --volume-id vol-ID
aws ec2 create-snapshot --volume-id vol-ID
while : ; do aws ec2 describe-snapshots --snapshot-ids snap-ID; sleep 5; done
aws ec2 create-volume --snapshot-id snap-ID --availability-zone ${AZ} --size ${SIZE}
aws ec2 attach-volume --volume-id vol-NEWID --instance-id i-ID --device /dev/sda1
aws ec2 start-instances --instance-id i-ID
aws ec2 describe-instance-status --instance-id i-ID
aws ec2 delete-snapshot --snapshot-id snap-ID
aws ec2 delete-volume --volume-id vol-ID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment