Last active
May 27, 2022 09:51
-
-
Save daubac402/db4b281ae901dc70b5f0cd28a45fb10f to your computer and use it in GitHub Desktop.
AWS - EC - EBS - Expand /dev/xvda + Make an Amazon EBS volume (/dev/xvdb) available for use to CentOS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check current partitions status | |
lsblk | |
# Expand /dev/xvda from 8GB (default) to your current EBS size (please increase your EBS volume in AWS Console then run these below commands) | |
sudo yum install -y epel-release | |
sudo yum install -y cloud-utils-growpart | |
growpart /dev/xvda 1 | |
reboot | |
# Make an Amazon EBS volume available for use on Linux (for eg: /dev/xvdb) | |
sudo yum install -y xfsprogs | |
sudo mkfs -t xfs /dev/xvdb | |
sudo mkdir /your_mount_destination_folder_path | |
sudo mount /dev/xvdb /your_mount_destination_folder_path | |
# Auto mount that Amazon EBS volume when stating | |
cp /etc/fstab /etc/fstab.old | |
blkid | |
/dev/xvda1: UUID="92c597ca-70f5-48ee-a173-64188df8ca24" TYPE="ext4" | |
/dev/xvdb: UUID="afe95686-8a5f-480f-aeb3-012bee11b523" TYPE="xfs" | |
vim /etc/fstab | |
append this line | |
UUID=afe95686-8a5f-480f-aeb3-012bee11b523 /your_mount_destination_folder_path xfs defaults,nofail 0 2 | |
Then test | |
sudo umount /your_mount_destination_folder_path | |
mount -a | |
df -h |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://stackoverflow.com/questions/24014493/unable-to-resize-root-partition-on-ec2-centos/38463651#38463651
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html