excercices
Attaching and Expanding an EBS Volume on an EC2 Instance
2
Attaching an Additional EBS Volume
Create a New EBS Volume (if not already created)
aws ec2 create-volume \
--region us-east-1 \
--availability-zone us-east-1a \
--size 20 \
--volume-type gp3Attach the Volume to the EC2 Instance
aws ec2 attach-volume \
--volume-id vol-0abcd1234efgh5678 \
--instance-id i-0123456789abcdef0 \
--device /dev/xvdf3
4
Expanding an Existing EBS Volume
Modify the Volume Size
aws ec2 modify-volume \
--volume-id vol-0abcd1234efgh5678 \
--size 40aws ec2 describe-volumes-modifications \
--volume-id vol-0abcd1234efgh5678 \
--filters Name=modification-state,Values=completedExtend Partition (if applicable)
lsblksudo growpart /dev/xvdf 1
Extend the Filesystem
sudo xfs_growfs /datasudo resize2fs /dev/xvdf1Verify the New Size
df -hT /data