Wednesday, April 4, 2018

Attach extra EBS volume to your AWS EC2 instance

You create your new volume from the "Volumes" menu in your EC2 management console.

You attach your new volume to your ec2 instance by right clicking the new volume and choose attach.

From the "Attachment Information", you can see where it is being attached, such as "/dev/sdf".

Or you can then see your new volume inside your EC2 instance:

$ cat /proc/partitions 
major minor  #blocks  name

 202        1    8388608 xvda1
 202       80   20971520 xvdf


Now format the new volume:

$ sudo mkfs.ext4 /dev/xvdf
(other example: sudo mkfs.xfs /dev/xvdb)

Then make a mount point:

$ sudo mkdir /mnt/data

mount the volume:

$ sudo mount /dev/xvdf /mnt/data/

Add it to /etc/fstab if you want it to automatically mount each time the EC2 instance starts.

Featured Post

British-based startup ARC unveiled its first motorcycle model in Milan this week

One being described as fast, advanced and expensive. The so-called Vector costs more than $100,000