- Newest
- Most votes
- Most comments
You need to amend the partition table for the underlying disk, basically Linux thinks that the end of the disk is 8GB after the start, this needs to be updated so that the at 16GB (it's more convoluted, but that's the gist of it). The tool to use for this bit would be fdisk
, gparted
or growpart
(whichever you are most comfortable with using).
After that, use resize2fs
to grow the ext4 filesystem (for reference, if the filesystem is xfs the command would be xfs_growsfs
).
Full details of all of these steps are here https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html
If you have successfully resized the EBS volume attached to your EC2 instance, You need to extend the file system on the instance to utilize the additional space that you've gained.
Try the below:
-
Check the Current File System: Before extending the file system, it's good to check the current state. You've done that in your provided output. The current file system is mounted on
/dev/xvda1
and is of typeext4
. -
Resize the File System: You can use the
resize2fs
command to resize the ext4 file system to take advantage of the newly added space. Replace/dev/xvda1
with your actual file system device name.sudo resize2fs /dev/xvda1
This command will automatically extend the file system to utilize the entire available space on the volume.
-
Verify the Result: After running the resize command, you can check the new size of your file system:
df -h
The output should show that your root partition (
/
) now has more available space.
Your system should now be using the full 16GB of your EBS volume. Keep in mind that these steps assume you're using a Linux-based operating system, specifically an ext4 file system. If you're using a different file system or operating system, the steps might vary slightly. Always make sure to have a backup of your important data before performing these kinds of operations, just in case.
Additionally, for Windows-based instances or other file system types, the process would be different. If that's the case, please provide more information, and I can guide you accordingly.
Relevant content
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
Agreed with Gabriel: resize2fs is the way to go