Tuesday, August 27, 2019

EBS-Volumes

Extra drives: volumes.
2 types of storage in ec2.
ebs(elasti block store): permanent storage which can be expanded
instance store: temporary storage which cannot be expanded.And data will be lost once we stop and start instance.Used for virtual memory for windows,swap memory for linux.And for tempdb in databases.



during ec2 instance selection page, in the storage tab, you can observe description like, "ebs only" means we can use ebs only.Some images, it is shown as "1 x 300(SSD)" means along with ebs, we will get this fixed storage also, along with the root drive mentioned.

lsblk --> will shsow drives
df -h --> will show partitions and folders

How to merge multiple disks and create a single drive -- LVM.
https://n2ws.com/blog/how-to-create-an-lvm-volume-on-aws

fdisk /dev/xvdc

and type n for new disk.

now create partition for this.
mkfs.ext3 /dev/xvdc1

mount the partition to a folder.
mount /dev/xvdc1 /7gbfolder/

To keep this configuration after restart, edit /etc/fstab and add the entry, as shown in the last line.



there are different types of disks..ssd,etc. So, while selecting that, IOPS need be calculated for billing.
You can calculate that using.
calculator.s3.amazonaws.com



Here, snapshots means, EBS volumes state copy at that point.
It is the volume/storage snapshot, not the VM snapshot like any Hypervisor.

snapshot: data state at a particular time.
right click, create a volume from the snapshot.
it will be visible in the volumes section.
we can attach this volume to an ec2 instance.

$lsblk
$mount /volume/attached /new/folder

Not necessary to detach a volume to do a snapshot, but recommended
Can copy snapshots across AZ or region

EBS volumes can be attached to only one instance at a time.
But we can attach in the same AZ for io1/io2 family.Each of these instances has full read & write permissions to the volume
Use case:
  • Achieve higher application availability in clustered Linux applications(ex: Teradata)
  • Applications must manage concurrent write operations
Also the file system for this Multi-Attach must be cluster-aware so XFS,EX4,etc are not supported.

more details about snapshots of aws: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSSnapshots.html



No comments:

Post a Comment