How to resolve the issue with the disk space of EC2 Linux machine?

0

Hello,
I probably face a basic issue.
I created a Linux EC2 machine with only 8 Gb of disk space.

Output of 'df' command:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/xvda1 8065444 5786008 2263052 72% /

Tried to go to AWS console to increase the attached volume.
In the Description tab, I see:
Root device type: ebs
Root device: /dev/sda1
Block device: /dev/sda1

Clicking on '/dev/sda1' volume ID, I was able to increase its size to 24 GiB.

However, when logging in via SSH, I still see only 8 Gb via 'df'.

Tried to reboot the machine, no change.

I noticed /dev/sda1 and /dev/xvda1 are not the same. But I have no idea how to apply the change to my disk.

Thanks for any hint.

Max

질문됨 4년 전1421회 조회
2개 답변
0

Hello Max,

The changes that you have made on the console will reflect only at the block level. You can run the command "lsblk" to see the new size on the instance that you have configured on the console.

lsblk -> This command lists the information about all available or the specified block devices

After you increase the size of an EBS volume, you must use file system–specific commands to extend the file system to the larger size.

The steps to extend your filesystem is well documented on this link below:

[1] Extending a Linux file system after resizing a volume - Identifying the file system for a volume - https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html#identify-linux-file-system

Moving on, there is no difference between sda1 and xvda1, they are exactly same. When you run your EC2 instance on a Xen hypervisor the xvd* are simply the Xen disk storage devices, therefore they appear instead of sda, etc.

AWS
답변함 4년 전
0

Thanks a lot.
I was able to solve the problem, using your advice and the article you mentioned.
Max.

답변함 4년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠