Voiced by Amazon Polly |
Introduction
If anything goes wrong, you can restore the volume anytime. To increase the flexibility of your web servers, you can later scale your web servers. This blog will help you increase the disk space of an Amazon EC2 instance.
Pioneers in Cloud Consulting & Migration Services
- Reduced infrastructural costs
- Accelerated application deployment
Prerequisites
AWS Account
Step-by-Step Guide
Step 1 – Backup EBS Volume
- Log in to your AWS account and go to EC2 service. Go to the Volumes tab under Amazon Elastic Block Store from the left side.
- It will give all the available EBS volumes there. Select the EBS volume of the instance you want to resize and click on the ‘Action’ button on top.
- Now it will ask for a description add, and in the last click on Create snapshot.
- Wait till the snapshot status changes to available. Move to the next section.
Step 2 – Create Physical Volume and add it to the Volume Group
- Execute the “gdisk” command to create a partition. For the variable Hex code or GUID, enter 8e00. In the below screenshot, we are creating the partition /dev/xvdf1 on /dev/xvdf.
2. Now execute the “pvcreate” command to create a physical volume from the partition.
3. Run the “vgcreate” command to create a volume group to combine the new physical volumes.
4. Use the “vgdisplay” to view the volume group details.
Step 3 – Create a Logical volume and mount a directory
- To create a logical volume, run “lvcreate” command to create logical volumes (partitions) from your volume group(vg1).
- Run the “lvdisplay” command to view the logical volume created in the above step.
3. Now create a directory using the “mkdir” command to mount the directory.
4. Execute the “mkfs -t” command to create the file system -t represents the target. Note: Replace xfs with your file system type if different. For example, use ext2, ext3, or ext4.
5. Run the “mount” command to mount the file system.
6. Edit “/etc/fstab” file so that the new mount remains permanent after reboot/ restart the machine.
Step 4 – Extend the Logical Volume
- Modify the size of the existing EBS volume.
2. Now execute the “growpart” command to extend the partition, and then run the “pvresize /dev/xvdf1” command to resize the physical volume. In the below example, partition /dev/xvdf1 is extended.
3. To check physical volume details, execute the “pvdisplay” command. Use the “vgdisplay” to view the volume group details.
4. Run the “lvextend” command to extend the logical volume. Use the “lvdisplay” command to view the logical volume details.
Note: –
To increase the XFS filesystem size, the xfs_growfs command is used.
Conclusion
We can expand volume at any time according to demand. More volumes can be added to existing LVM volume instead of creating a snapshot of a volume and expanding it with improved performance and availability.
Making IT Networks Enterprise-ready – Cloud Management Services
- Accelerated cloud migration
- End-to-end view of the cloud environment
About CloudThat
CloudThat is a leading provider of Cloud Training and Consulting services with a global presence in India, the USA, Asia, Europe, and Africa. Specializing in AWS, Microsoft Azure, GCP, VMware, Databricks, and more, the company serves mid-market and enterprise clients, offering comprehensive expertise in Cloud Migration, Data Platforms, DevOps, IoT, AI/ML, and more.
CloudThat is the first Indian Company to win the prestigious Microsoft Partner 2024 Award and is recognized as a top-tier partner with AWS and Microsoft, including the prestigious ‘Think Big’ partner award from AWS and the Microsoft Superstars FY 2023 award in Asia & India. Having trained 850k+ professionals in 600+ cloud certifications and completed 500+ consulting projects globally, CloudThat is an official AWS Advanced Consulting Partner, Microsoft Gold Partner, AWS Training Partner, AWS Migration Partner, AWS Data and Analytics Partner, AWS DevOps Competency Partner, AWS GenAI Competency Partner, Amazon QuickSight Service Delivery Partner, Amazon EKS Service Delivery Partner, AWS Microsoft Workload Partners, Amazon EC2 Service Delivery Partner, Amazon ECS Service Delivery Partner, AWS Glue Service Delivery Partner, Amazon Redshift Service Delivery Partner, AWS Control Tower Service Delivery Partner, AWS WAF Service Delivery Partner, Amazon CloudFront Service Delivery Partner, Amazon OpenSearch Service Delivery Partner, AWS DMS Service Delivery Partner, AWS Systems Manager Service Delivery Partner, Amazon RDS Service Delivery Partner, AWS CloudFormation Service Delivery Partner, AWS Config, Amazon EMR and many more.
FAQs
1. What type of performance can I expect from Amazon EBS volumes?
ANS: – Performance depends on the type of EBS volume. Amazon provides a total of seven types of EBS volume Provisioned IOPS SSD (io2 Block Express, io2, and io1), General Purpose SSD (gp3 and gp2), Throughput Optimized HDD (st1), and Cold HDD (sc1).
2. Can we stripe multiple EBS volumes together to get better performance?
ANS: – Yes, you can stripe multiple EBS volumes together to get up to 260,000 IOPS or 60,000 Mbps (or 7500 MB/s) when attached to larger EC2 instance types.
3. What is an Amazon EBS snapshot?
ANS: – Amazon EBS snapshots are the backup of EBS volumes that help recover data on disk failure or loss.

WRITTEN BY Mayank Bharawa
Comments