[AWS] How to expand storage size
1 Resizing EBS Volumes
Locate the EBS volume that needs to be expanded in the instance Storage information on the EC2 — Instance page and click on the corresponding Volume ID in order to access the EBS Volumes page.
Check the volumes that need to be expanded, and then click Actions — Modify volume
Enter the target storage size and click the Modify button
Click the Modify button
2 Linux File System Expansion
2.1 LVM Environment
a. Retrieve the disk information
Use lsblk to view the current partition information, assuming we need to expand the root volume, i.e. the third partition of the nvme0n1 disk: nvme0n1p3
# lsblk
b. Expand the physical partition
# partprobe /dev/nvme0n1
# growpart /dev/nvme0n1 3
Examining the partition information again, you can see that the size of partition 3 has changed
c. Expand logical volume
lvextend -l +100%FREE /dev/mapper/cs-root
d. Expand the file system
xfs_growfs /
Use the df command to check the results of the expansion
df -Th