This isn't really supposed to be a "post", but instead a reminder for myself and anyone else in the future who wants to mount an existing EBS Volume to an EC2 instance in Amazon's AWS. Hmm ... wonder if I can throw around a few more acronyms in the next hundred words or so.
First things first, create an EBS Volume and attach it to the server you want to use it. This can be done with some simple mouse clicks in the AWS Web Interface. From there, the rest is done through SSH to the server itself.
Here are the few simple steps required to format and mount the new volume to the server:
- run "/sbin/mkfs.ext3 /dev/sdf" (be sure to change sdf to the sd* you entered when creating the EBS Volume)
- next "echo “/dev/sdf /vol ext3 noatime 0 0″ >> /etc/fstab", which will allow the volume to mount on boot
- next "mkdir /ebs" (or some directory to mount the new volume to)
- then "mount /dev/sdf /ebs" (be sure to change sdf and ebs to the locations specific to your environment)
- finally, "df -h" to see the new volume has mounted.
That's all there is to it, though it can be tricky the first few times.