By using AWS re:Post, you agree to the Terms of Use

Do I need to extend EC2 file system after resizing?

0

I increased the size of a gp2 EBS attached to a Linux EC2 instance from 8GB to 25GB. From the documentation, I thought I would then need to extend the Linux file system. However, I think that the output of lsblk is telling me that it has happened automatically and I do not need to do anything. I have pasted the output below. I think it is saying that I have a 25G EBS volume called xvda and that has 3 partitions in it. One of them, xvda1, is 24.9G. If that is correct then presumably I do not have to do anything more. I can just use the extra space. Please correct me if I am wrong.

ubuntu@ip-172-31-32-80:~$ sudo lsblk
NAME     MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
loop0      7:0    0 25.1M  1 loop /snap/amazon-ssm-agent/5656
loop1      7:1    0 43.9M  1 loop /snap/certbot/2192
loop2      7:2    0 55.5M  1 loop /snap/core18/2409
loop3      7:3    0 55.6M  1 loop /snap/core18/2538
loop4      7:4    0   62M  1 loop /snap/core20/1593
loop5      7:5    0   62M  1 loop /snap/core20/1611
loop6      7:6    0 79.9M  1 loop /snap/lxd/22923
loop7      7:7    0  103M  1 loop /snap/lxd/23541
loop8      7:8    0   47M  1 loop /snap/snapd/16010
loop9      7:9    0   47M  1 loop /snap/snapd/16292
xvda     202:0    0   25G  0 disk 
├─xvda1  202:1    0 24.9G  0 part /
├─xvda14 202:14   0    4M  0 part 
└─xvda15 202:15   0  106M  0 part /boot/efi
ubuntu@ip-172-31-32-80:~$
2 Answers
1
Accepted Answer

Some operating systems will automatically detect larger (expanded) disks available to them and extend the file systems for you. This appears to be the case here.

profile picture
EXPERT
answered a month ago
1

There is a step of extending the filesystem depending on the FS type. Check the FS size by using the df command. lsblk shows the disk is extended and OS is able to recognize that.

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html

answered a month ago

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