LVM

//////volumes(nothing but disk/storage)

snapshot –> taking the back up of a volume

simple steps to use/copy a volume of one server to another server::
take existing volume backup —> snapshot —> convert snapshot to volume —> now we can attach volume to another server

steps to resize ec2 volumes/storage:

1: copy the instances id
2: click on volumes and filter with instance id
3: select the instance and click on actions and modify volume
4: select required size and hit modify
5: restart server and check the storage now(df -h)

note: we cant downgrade the volume sizes.

//process to create a seperate external volume and attaching it to the existing server.

lsblk
/* to list the block storages

now create a volume of your required size in you aws console later follow below steps to attach that volume to existing EC2 instance

Mount an EBS volume to EC2 Linux::

Step1 : Now, login to your ec2 instance and list the available disks using the following command.
Lsblk

Step 2: Check if the volume has any data using the following command.
sudo file -s /dev/xvdf

Step 3: Format the volume to ext4 filesystem using the following command.
sudo mkfs -t ext4 /dev/xvdf

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

Step 5: Mount the volume to “newvolume” directory using the following command.
sudo mount /dev/xvdf /newvolume/

Step 6: cd into newvolume directory and check the disk space for confirming the volume mount.
cd /newvolume
df -h .

finished

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

Note::
By default on every reboot the EBS volumes other than root volume will get unmounted. To enable automount, you need to make an entry in the /etc/fstab file.

///EBS Automount on Reboot

  1. Back up the /etc/fstab file.
    sudo cp /etc/fstab /etc/fstab.bak
  2. Open /etc/fstab file and make an entry in the following format.

device_name mount_point file_system_type fs_mntops fs_freq fs_passno
Example:
/dev/xvdf /newvolume ext4 defaults,nofail 0 0

3.Execute the following command to check id the fstab file has any error.
sudo mount -a

////////////////////////IAM(Identity access management) & S3(Simple Storage)