Feb 7, 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

Setup Chinese Input Method in Ubuntu 17.10 Artful

sudo apt install ibus-sunpinyin After either of those commands do not forget to restart the IBus daemon ibus restart You might need t...