EBS storage (elastic block storage)
- ebs is storage service provided by aws that is used in ec2 instance
- its acts a storage disk (vloume)
Key features:
- block-level storage: data is fixed storage disk – not object like s3
- one instance at a time : an ebs will attach one device only\
- low latency: heavy workloads and faster access
- performace: high performace for read/wirte operations
- snapshots: back up of ebs vloume ==> stored in s3
- Manual scalling: increasing vloume size / modify vloume
Note: ebs volume and ec2 instance must be same avialbilty zone
How its works
flowchart LR
A[Create EBS volume] --> B[Attach to EC2 instance]
B --> C[Format & mount as a disk]
C --> D[Use it for storing data]
- create ebs vloume
- select volume type like gp2, gp3, iop1, iop2, …etc
- size of vloume 10 gb
- select az location same as ec2 location
- attach volume to ec2
- ec2 instance
- mount path like
/dev/dvfc
- format disk and paration volume
### show all disks
```lsblk```
### parted vloume
```sudo parted /dev/nvme1n1```
```bash
GNU Parted 3.6
Using /dev/nvme1n1
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt
(parted) mkpart primary ext4 0% 100%
(parted) quit
Information: You may need to update /etc/fstab.
format parted
sudo mkfs -t ext4 /dev/nvme1n1
sudo mkdir /data sudo mount /dev/nvme1n1 /data
update fstab
sudo lsblk -o +UUID
vi /etc/fstab
UUID=d6166c7c-d716-4a25-926d-f00ff49d49fb /data ext4 defaults,nofail 0 2
sudo umount /data systemctl daemon-reload sudo mount -a
verify disk
df -h ==> disk free space (-h human readable) lsblk ==> disk and parted mount ==> mounted disks
