Create ,Attach and mount EBS volume on ec2 instance
Full-Stack Developer | MERN + Next.js | DevOps & Cloud Enthusiast
I specialize in building dynamic web applications using the MERN stack and Next.js. Currently exploring DevOps and cloud technologies to streamline workflows, automate deployments, and optimize cloud infrastructure for scalable, efficient solutions.
Start ec2 instatance or launch a fresh one.

2. Run lsblk you can see the disk is attached

Create Volumes for this use ebs . for this tutorial i am creatimg 3 volumes

Attach the volume

swith to roo
run lvm command
to see pjysical storage run “pvs“
create a physical volume by this command : “pvcreate /dev/xvdg /dev/xvgh “
run pvs command to show the physical voume
create a volume group
vgcreate basir_vol_grp /dev/xvdf /dev/xvdg by running this command
run vgs to show volume group
create a logical voulune on top of it
lvcreate -L 10G -n basir_vol basir_vol_grp by running this command
run pvdisplay to get all pjysical volume information
run lsblk to see logical volume is there or not
mount this volumes
if you run df -h to see all of this not mounted
create a mounting folder
mkdir /mnt/basirfolder by running this command
format logical volume
mkfs.ext4 /dev/basir_vol_grp/basir_vol by running this comand
mounting volume
mount /dev/basir_vol_grp/basir_vol /mnt/basirfolder by running this command
run df -h to see it is properly mounted or not
for unmounting run this command umount /mnt/basirfolder
one good question is data lost or not if i unmount
answer is mount again its back again try it at your end
for mounting afresh ebs to a linux_ins
create a mounting folder mkdir /mnt/basiraws
formating ebs voulume by running this command : mkfs -t ext4 /dev/xvdh
mount this using mount /dev/xvdh /mnt/basiraws
want to extend logical volume
lvextend -L +5G /dev/basir_vol_grp/basir_vol by running this command






