{"id":47083,"date":"2024-09-09T04:51:58","date_gmt":"2024-09-09T04:51:58","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=47083"},"modified":"2024-09-09T04:53:20","modified_gmt":"2024-09-09T04:53:20","slug":"aws-tutorials-ebs-steps-to-increase-the-disk-size-on-a-running-ec2-instance","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/aws-tutorials-ebs-steps-to-increase-the-disk-size-on-a-running-ec2-instance\/","title":{"rendered":"AWS Tutorials: EBS &#8211; Steps to Increase the Disk Size on a Running EC2 Instance:"},"content":{"rendered":"\n<p>you can increase the disk size of an Amazon EC2 instance while it is running. Amazon allows you to modify the size of an Elastic Block Store (EBS) volume, which is the disk attached to your EC2 instance. Here&#8217;s how you can do it:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Steps to Increase the Disk Size on a Running EC2 Instance:<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">1. <strong>Modify the EBS Volume in the AWS Console<\/strong><\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go to the <strong>EC2 Dashboard<\/strong> in the AWS Management Console.<\/li>\n\n\n\n<li>Click on <strong>Volumes<\/strong> under the &#8220;Elastic Block Store&#8221; section on the left-hand menu.<\/li>\n\n\n\n<li>Find the EBS volume attached to your EC2 instance.<\/li>\n\n\n\n<li>Select the volume and click on the <strong>Actions<\/strong> dropdown menu.<\/li>\n\n\n\n<li>Choose <strong>Modify Volume<\/strong>.<\/li>\n\n\n\n<li>In the &#8220;Size&#8221; field, change the disk size from <code>50 GB<\/code> to <code>100 GB<\/code>.<\/li>\n\n\n\n<li>Click <strong>Modify<\/strong> to save the changes.<\/li>\n<\/ol>\n\n\n\n<p>The disk size will be increased, but the additional space will not be available to the EC2 instance until you resize the partition on the operating system.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">2. <strong>Resize the Partition on the EC2 Instance<\/strong><\/h4>\n\n\n\n<p>After modifying the volume size, you need to extend the partition on your EC2 instance so that it can use the newly added space. The steps vary depending on the operating system of your instance (Linux or Windows).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>For Linux Instances<\/strong>:<\/h3>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"875\" height=\"648\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2024\/09\/image-2.png\" alt=\"\" class=\"wp-image-47085\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2024\/09\/image-2.png 875w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2024\/09\/image-2-300x222.png 300w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2024\/09\/image-2-768x569.png 768w\" sizes=\"auto, (max-width: 875px) 100vw, 875px\" \/><\/figure>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Connect to the EC2 instance<\/strong> via SSH.<\/li>\n\n\n\n<li><strong>Check the current disk size<\/strong> to confirm that the volume has been extended:bash<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">lsblk\nsudo resize2fs \/dev\/xvda1\nsudo xfs_growfs \/\ndf -h<\/code><\/span><\/pre>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>For Windows Instances<\/strong>:<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Connect to the EC2 instance<\/strong> via Remote Desktop Protocol (RDP).<\/li>\n\n\n\n<li>Go to <strong>Disk Management<\/strong>:\n<ul class=\"wp-block-list\">\n<li>Right-click the <strong>Start<\/strong> button and select <strong>Disk Management<\/strong>.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Find the EBS volume (usually <code>C:<\/code>) and notice the unallocated space.<\/li>\n\n\n\n<li>Right-click on the partition and select <strong>Extend Volume<\/strong>.<\/li>\n\n\n\n<li>Follow the steps in the wizard to extend the volume.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Things to Note<\/strong>:<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The process does not cause downtime, and the instance remains running.<\/li>\n\n\n\n<li>Make sure to create a snapshot of the volume before modifying it to ensure you have a backup in case of any issues.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>you can increase the disk size of an Amazon EC2 instance while it is running. Amazon allows you to modify the size of an Elastic Block Store (EBS) volume, which&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[2],"tags":[],"class_list":["post-47083","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/47083","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=47083"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/47083\/revisions"}],"predecessor-version":[{"id":47086,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/47083\/revisions\/47086"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=47083"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=47083"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=47083"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}