EBS Storage size not increased after Instance Type upgrade (Linux)

0

We have upgraded the instance Type recently, which basically doubled the capacity of the instance. The cores and memory has been increased and we can see that, but the EBS Storage attached to the instance still shows the old size and not the increased size. Is there something we are missing here ? do we need to manually resize the EBS Storage attached to the instance ?

asked 5 months ago551 views
3 Answers
4

Hello , Certainly! Here’s a concise version of the steps to increase the EBS volume size and extend the file system on your Linux instance:

Steps to Resize EBS Volume

  1. Modify EBS Volume Size Sign in to AWS Management Console. Navigate to EC2 Dashboard > "Volumes". Select Volume > "Actions" > "Modify Volume". Enter New Size > "Modify" > Confirm.

  2. Extend File System on the Instance Connect to EC2 Instance via SSH:

ssh -i <your-key-pair.pem> ec2-user@<your-instance-public-dns>

Verify New Volume size: => lsblk Extend File System: =>sudo resize2fs /dev/xvdf1 //for ext4 =>sudo xfs_growfs -d / //xfs

=>Verify Extended File System: df -h

EXPERT
answered 5 months ago
profile picture
EXPERT
reviewed 5 months ago
EXPERT
reviewed 5 months ago
1
Accepted Answer

Yes, you need to adjust the EBS volume size separately. The EC2 instance size only determines the compute capacity, such as processor type and architecture, number of cores and vCPUs, amount of memory, network bandwidth, and so on.

Instructions for increasing the EBS volume size are in this documentation article: https://docs.aws.amazon.com/ebs/latest/userguide/requesting-ebs-volume-modifications.html

Note also that the storage capacity of an EBS volume can only be increased. You can't decrease it later. To reduce the size, you would have to create a new EBS volume with the smaller size and copy your data at the operating system level.

You can, however, adjust the IOPS (I/O operations per second) and throughput (megabytes per second) performance settings both up and down for volume types that support configuring them, such as gp3: https://docs.aws.amazon.com/ebs/latest/userguide/general-purpose.html#gp3-ebs-volume-type

EXPERT
answered 5 months ago
profile picture
EXPERT
reviewed 5 months ago
profile picture
EXPERT
reviewed 5 months ago
  • This is what I have now after adjusting EBS volume as suggested here. /dev/root volume still shows as 240 GB only :

    => sudo lsblk

    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT nvme0n1 259:0 0 600G 0 disk └─nvme0n1p1 259:1 0 240G 0 part / nvme2n1 259:2 0 279.4G 0 disk nvme1n1 259:3 0 279.4G 0 disk

    => sudo -hT

    Filesystem Type Size Used Avail Use% Mounted on /dev/root ext4 233G 197G 37G 85% / devtmpfs devtmpfs 31G 0 31G 0% /dev tmpfs tmpfs 31G 0 31G 0% /dev/shm tmpfs tmpfs 6.2G 896K 6.2G 1% /run tmpfs tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs tmpfs 31G 0 31G 0% /sys/fs/cgroup

    => sudo resize2fs /dev/root resize2fs 1.45.5 (07-Jan-2020) The filesystem is already 62914299 (4k) blocks long. Nothing to do!

0

Your lsblk output shows the root file system located in a partition, so you'll have to extend the partition first and only extend the file system with resize2fs after that. Please try this:

sudo growpart /dev/nvme0n1 1
EXPERT
answered 5 months ago
  • Thanks a lot Leo. That worked out perfectly.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions