Voiced by Amazon Polly
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
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.
To increase the XFS filesystem size, the xfs_growfs command is used.
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
CloudThat is an official AWS (Amazon Web Services) Advanced Consulting Partner and Training partner and Microsoft Gold Partner, helping people develop knowledge of the cloud and help their businesses aim for higher goals using best in industry cloud computing practices and expertise. We are on a mission to build a robust cloud computing ecosystem by disseminating knowledge on technological intricacies within the cloud space. Our blogs, webinars, case studies, and white papers enable all the stakeholders in the cloud computing sphere.
Drop a query if you have any questions regarding Amazon EBS Volume and I will get back to you quickly.
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