aizu's Knowledge Base
    • Go to: aizu.my Homepage
    • Recent
    • Tags
    • Register
    • Login

    EC2 - increase storage without turn off instance

    Linux
    1
    1
    41
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      aizu
      last edited by aizu

      To increase the space on your AWS instance, follow these steps:

      1. Check the Available Storage:
      Before expanding, verify the disk space:

      df -h
      

      2. Identify the Volume:
      Find the attached volumes for your EC2 instance:

      Go to the EC2 Console.
      Under Elastic Block Store (EBS), select Volumes.
      Identify the volume attached to your instance.

      3. Modify the EBS Volume:
      Select the volume you want to expand.
      Click on Actions → Modify Volume.
      Increase the size of the volume (e.g., from 8 GB to 20 GB).
      Click Modify.

      4. Extend the Partition on the EC2 Instance:
      After the volume is resized, you'll need to extend the file system to use the new space.

      For ext4 file system:
      Verify the volume size:

      lsblk
      

      Make sure the resized volume reflects the correct size.
      Extend the file system:

      sudo growpart /dev/nvme0n1 1
      sudo resize2fs /dev/nvme0n1p1
      

      For xfs file system:
      Extend the file system:

      sudo xfs_growfs -d /
      

      5. Verify the Increased Space:
      Check the disk space again:

      df -h
      

      This process will allow you to increase the disk space without stopping the instance.

      To check partition type

      lsblk -f
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post