How To Increase EBS Volume
Posted By : Vinay Mann | 24-Jun-2022
To Increase the size of EBS volume without any downtime
This is a practice where we perform how to resize the volume of an EC2 instance
without any downtime on our server.
Before this let’s take an introduction about the EC2 instance and Volumes
EC2 :
EC2 called Elastic Cloud Compute is a virtual machine that represents a physical server for users to deploy their applications. Instead of getting your hardware system and connecting it to the network, Amazon cloud provides you nearly unlimited virtual machines on the cloud to run your applications while they manage the hardware. EC2 instances provide a feature that is radical to cloud computing called Auto-Scaling Groups. This feature allows EC2 instances to automatically add additional computing power like CPU utilization which gets affected due to high demand. AWS provides support for multiple operating systems from Windows to different flavors of Linux etc. As a customer, you can also able to bring your customized OS images and run them on their platform. This allows users to use boundless capabilities for running applications on the cloud.
Volumes :
AWS EBS is mainly defined as a raw block-level storage service or device, meant to be used with EC2 instances. Each block on the cloud acts like a hard drive, where you can store any type of file or even a whole operating system can be installed on that block device. Each EBS volume that you connect with your EC2 instance is automatically replicated within its AZ to prevent any loss of data and component failure on the cloud. With EBS, we can easily scale our usage up or down in a matter of minutes.
For this, we have to follow some set of commands and we will be able to resize it.
Firstly you have to add the volume from the AWS cloud console.
Commands:
- df -hT
This command list out the mount devices with their file system but you will not be able to see the extended volume partition
- lsblk
Now using this command will be able to see the extended volume partition
- sudo growpart /dev/xvda 1
This command will increase the partition size but you have to mention the
partition name
- sudo xfs_growfs -d /
This command will resize your actual volume and this for
Xfs file system
#Note: The growfs command depends on the file system
4. sudo resize2fs /dev/nvme0n1p1
( This is for ext2,ext3 and ext4 file system )
- df -hT ( you will see that your volume gets extended with the new size.)
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Vinay Mann
Vinay is a highly experienced DevOps Engineer with expertise in various industry-standard tools and technologies. His skill set includes Linux administration, AWS services, Docker, Kubernetes, Ansible, Git, Jenkins, Terraform, Python, and Shell scripting. He has contributed to projects like Oodles dashboard, Communication Scaffold, and Oodles.com. Vinay has also earned certifications in AWS Solution Architect and RHCSA, demonstrating his proficiency in these domains. He plays a crucial role in ensuring the seamless functioning of software development and deployment processes.