My name is Brian Whitman. I am a lapsed scientist and sound artist currently co-founder/CTO at The Echo Nest, a music intelligence company in Somerville, MA. As I work on various scaling and media search problems with detours into art projects I'll be posting details here in the hopes that I can learn from others. I'd always like to hear from you if you are working on similar things.
This is all you have to do…
create_mount_ebs() {
# Make and mount an EBS. Note: your instance has to be on us-east-1a.
SIZE="$1" # in GB
log "creating and mounting a $1 GB EBS to /vol"
VOL=`ec2-create-volume -z us-east-1a -s $SIZE | awk '{print $2}'`
# Check for it on a loop..
AVAILABLE="unavailable"
while [ "$AVAILABLE" != "available" ]
do
AVAILABLE=`ec2-describe-volumes $VOL | awk '{print $5}'`
done
# Now attach it
INSTANCE=`curl http://169.254.169.254/latest/meta-data/instance-id 2> /dev/null`
ec2-attach-volume -d /dev/sdh -i $INSTANCE $VOL
apt-get install -y xfsprogs
mkfs.xfs /dev/sdh
echo "/dev/sdh /vol xfs noatime 0 0" >> /etc/fstab
mkdir /vol
mount /vol
}