How to resolve the issue with the disk space of EC2 Linux machine?
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
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.
Thanks a lot.
I was able to solve the problem, using your advice and the article you mentioned.
Max.
Relevant questions
[errno 28] no space left on disk
asked a month agoHow to resolve the issue with the disk space of EC2 Linux machine?
asked 2 years agoWhat does "provisioned" mean for EBS pricing?
asked 3 years agoChange platform of EC2 instance
asked 2 months agoApache and OpenSSL running on its EC2 instances bundled with RedHat Linux 8 are outdated, how to best resolve this
asked 5 months agolinux partition on Lightsail
asked 24 days agoHow do I know the space (in GB) used by a "Snapshot"?
asked 2 years agoRedshift recommended free space percentage
Accepted Answerasked 4 years agoWorkdocs - Space in Drive C - Windows
Accepted Answerasked 4 months agoHow to migrate the specific Linux partition rather than the entire disk
Accepted Answerasked 24 days ago