- Create a volume:
aws ec2 create-volume --availability-zone us-east-1a
Take note of the returned VolumeId in the response. It will start with vol- followed by alphanumeric characters.
- Attach the volume to the instance, using the volume ID noted in the last step and the instance ID you started with:
aws ec2 attach-volume \ --volume-id <your-volume-id> \ --instance-id <your-instance-id> \ --device /dev/sdf
- On the instance itself, mount the volume device:
mount /dev/xvdf /mnt/volume