Skip to main content

Command Palette

Search for a command to run...

Create ,Attach and mount EBS volume on ec2 instance

Updated
•2 min read
B

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.

  1. Start ec2 instatance or launch a fresh one.

2. Run lsblk you can see the disk is attached

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

    Attach the volume

  2. swith to roo

  3. run lvm command

  4. to see pjysical storage run “pvs“

  5. create a physical volume by this command : “pvcreate /dev/xvdg /dev/xvgh “

  6. run pvs command to show the physical voume

  7. create a volume group

  8. vgcreate basir_vol_grp /dev/xvdf /dev/xvdg by running this command

  9. run vgs to show volume group

  10. create a logical voulune on top of it

  11. lvcreate -L 10G -n basir_vol basir_vol_grp by running this command

  12. run pvdisplay to get all pjysical volume information

  13. run lsblk to see logical volume is there or not

  14. mount this volumes

  15. if you run df -h to see all of this not mounted

  16. create a mounting folder

  17. mkdir /mnt/basirfolder by running this command

  18. format logical volume

  19. mkfs.ext4 /dev/basir_vol_grp/basir_vol by running this comand

  20. mounting volume

  21. mount /dev/basir_vol_grp/basir_vol /mnt/basirfolder by running this command

  22. run df -h to see it is properly mounted or not

  23. for unmounting run this command umount /mnt/basirfolder

  24. one good question is data lost or not if i unmount

  25. answer is mount again its back again try it at your end

  26. for mounting afresh ebs to a linux_ins

  27. create a mounting folder mkdir /mnt/basiraws

  28. formating ebs voulume by running this command : mkfs -t ext4 /dev/xvdh

  29. mount this using mount /dev/xvdh /mnt/basiraws

  30. want to extend logical volume

  31. lvextend -L +5G /dev/basir_vol_grp/basir_vol by running this command

37 views

More from this blog

"

"Mastering DevOps, Full Stack Development, AWS & Cutting-Edge Tech | Insights & Tutorials

13 posts

sudo certbot -d '*.host.deploylite.tech' --manual --preferred-challenges dns certonly