How to do it...

  1. 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.
  1. 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
  1. On the instance itself, mount the volume device:
      mount /dev/xvdf /mnt/volume

Get AWS Administration Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.