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

posta 4 anni fa1421 visualizzazioni
2 Risposte
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
con risposta 4 anni fa
0

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

con risposta 4 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande