Add EBS volume to a Linux EC2 Instance

  1. Create an EBS volume using the AWS console (WEB UI)
  2. Using the AWS console, attach the EBS volume to running instance. The attached volume may get assigned to /dev/sdf (EC2’s external name for this particular device number).
  3. Format file system /dev/xvdf (Ubuntu’s internal name for this particular device number):
    sudo mkfs.ext4 /dev/xvdf
    
  4. Mount file system (with update to /etc/fstab so it stays mounted on reboot):
    sudo mkdir -m 000 /vol
    echo "/dev/xvdf /vol auto noatime 0 0" | sudo tee -a /etc/fstab
    sudo mount /vol
    

For more info: http://stackoverflow.com/questions/11535617/add-ebs-to-ubuntu-ec2-instance

 

Advertisements

One thought on “Add EBS volume to a Linux EC2 Instance

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s