Posts Tagged ‘EBS’

Attaching an EBS volume to Amazon EC2 instance

The EC2 backed Amazon’s instances come with a limited storage space by default(8GB to be specific mounted on /). However, some applications may require much more instance space. This can be accomplished by attaching an EBS storage to the your EC2 instance. Attaching extra storage on EC2 instance is pretty easy and you got to follow a few very simple steps:
  • Allocate a new EBS in your amazon AWS EC2 dashboard. The option comes under the heading volumes in the major head Elastic Block Storages. You will be asked for the size you want to allocate. The availability zone must be the same as the Amazon EC2 instance’s zone to which you want to connect this volume to.
  • In the list of volumes, attach the newly created EBS volume to the desired instance(As you select the volume using the checkbox, an option will appear on the top to attach it to an instance).
  • Now connect to your instance using ssh and run sudo fdisk -l. In the meantime do checkout our latest SIP Calculator fdisk will show the list of volumes and your newly created volume should appear unpartioned in this list. Format the file system /dev/xvdf(ubuntu’s external name to your drive) using the following command:
    sudo mkfs.ext4 /dev/xvdf
  • Mount the volume onto the system and add it to /etc/fstab for mounting at the system start(Here we assume that you will mount to /vol, this can be any directory that you like):
    sudo mkdir -m 000 /vol
    echo "/dev/xvdf /vol auto noatime 0 0" | sudo tee -a /etc/fstab
    	sudo mount /vol 
  • Thats it, enjoy your extended partition !!