Skip to content

Instantly share code, notes, and snippets.

@brantfaircloth
Created July 9, 2012 22:47
Show Gist options
  • Save brantfaircloth/3079547 to your computer and use it in GitHub Desktop.
Save brantfaircloth/3079547 to your computer and use it in GitHub Desktop.
Mount ephemeral storage on AWS

# start the instance:

ec2-run-instances --key /path/to/my/ec2-keypair ami-74f0061d --instance-type=c1.xlarge --block-device-mapping '/dev/sda2=ephemeral0' --block-device-mapping '/dev/sda3=ephemeral1'

# mount the ephemeral storage:

sudo su
mkdir /mnt/data
mount /dev/sda2 /mnt/data

# give ownership to ec2-user
chown ec2-user:ec2-user /mnt/data
# exit from root
exit

# rsync data from your computer to the instance:

rsync -avz -e "ssh -i /path/to/my/ec2-keypair" /path/to/my/data [email protected]:/mnt/data/

# do stuff

# get data from instance:

rsync -avz -e "ssh -i /path/to/my/ec2-keypair" [email protected]:/mnt/data/ /path/to/my/results
@ricardojohnny
Copy link

Other mounts for rsync this is in instance aws?
sudo sed -i 's/mounts.*//g' /etc/cloud/cloud.cfg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment