Pages

Tuesday, February 18, 2020

Elastic Block Storage ( EBS )

Amazon EBS is like a Hard drive in the cloud that provides Persistent block storage volumes for use with Amazon Ec2 Instances. The volumes that we create can be attached to your Ec2 Instance and allows one to create a file system on the top of those volumes. The volumes attached or mounted on to a Ec2 instance can be used to store data, run a database server or use them in any other way.

Amazon Ebs provides 5 types of volumes,
General Purpose SSD ( gp2 ) : If you need a balance of both performance and price, this is the one to choose. this is the default volume that gets attached to the Ec2 instance. SSD stands for Solid state Drive which is multiple times faster than HDD ( Hard Disk drive ). this is a very good type for performing small input/output operations. Having this SSD volume as your root volume will increase the Ec2 performance. 

These Ebs Volumes provide a ratio of 3 IOPS per GB with the ability to burst up to 3000 IOPS for extended period of time. They support unto 10000 IOPS and 160MB/s of throughput. 1 IOPS operations is equal to 256KB/s of read or write operation.

Provisioned IOPS SSD (io1) : This type if the fastest and most expensive Eps volumes. They are designed for High I/O intensive applications like Large Relational or NoSql Databases. The Size of this volume ranges from 4 GB to 16GB and IOPS range from 100 IOPS to 32000 IOPS.

Throughput Optimised HDD (st1) : This a low cost magnetic Storage volume which define performance in terms of throughput. These are designed for large, sequential workloads like Big data, log processing etc.

Cold HDD ( sc1 ) : These are even cheaper magnetic storage than the Throughput optimised. They are for large sequential cold workloads like file server. These are good for infrequently accessed workloads. 

Magnetic : They are previous generation magnetic drives that are suited for workloads that are infrequently accessed.

Creating a EBS volume and attaching to the Ec2 Instance
Go to volumes -> Elastic Block Storage -> Ec2 Instance

Click on Create. Once the Ebs volume is created. Go to volumes and attach the volume to an Instance. Attach the volume as,
If we can see the volume is attached on device as /dev/sdf. Now once the volume is attached,it does not mean it is available to use. We have to first perform certain steps to use the volume. Check the volume mounted,

Check if the volume has any data using the following command.
[root@ip-200-0-1-59 html]# sudo file -s /dev/xvdf
/dev/xvdf: data

If the above command output shows “/dev/xvdf: data”, it means your volume is empty.

Format the file system,
[root@ip-200-0-1-59 html]# sudo mkfs -t ext4 /dev/xvdf
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
65536 inodes, 262144 blocks
13107 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=268435456
8 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376

Allocating group tables: done                        
Writing inode tables: done                        
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done

Create a directory of your choice to mount our new ext4 volume. I am using the name “newvolume”
sudo mkdir /newvolume

Mount the volume
sudo mount /dev/xvdf /newvolume/

Now we can use the volume. To unmount the volume, you have to use the following command. umount /dev/xvdf.

No comments :

Post a Comment