Skip to content

Instantly share code, notes, and snippets.

@oisin
Created January 20, 2012 15:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oisin/1647905 to your computer and use it in GitHub Desktop.
Save oisin/1647905 to your computer and use it in GitHub Desktop.
Scripts to create/attach/snapshot multiple EBS volumes
(i=0; for vol in $(awk '{print $2}' vol_snaps.txt); do i=$((i+1)); ec2-attach-volume $vol -i i-aa3bc4c8 -d /dev/sdv${i}; done)
(i=0; for vol in $(awk '{print $2}' vols.txt); do i=$((i+1)); ec2-attach-volume $vol -i i-11eee072 -d /dev/sdh${i}; done)
for vol in $(awk '{print $2}' snapshots.txt); do ec2-create-volume --availability-zone us-east-1a --snapshot $vol; done > vol_snaps.txt
(i=0; for vol in $(awk '{print $2}' backup_vols.txt); do i=$((i+1)); ec2-create-snapshot $vol --description "MongoDB RAID backup${i}"; done)
for x in {1..4}; do ec2-create-volume -s 4 -z us-east-1a; done > vols.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment