How did I increase the size of an EBS volume in an AWS EC2 instance (Debian 10)?

Step 1

Modify an EBS volume using Elastic Volumes (console)

Step 2

To check whether the volume has a partition that must be extended, use the lsblk command to display information about the NVMe block devices attached to your instance.

docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html#extend-file-system-nvme

lsblk

02

Step 3

For volumes that have a partition, such as the root volume shown in the previous step, use the growpart command to extend the partition.

docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html#extend-file-system-nvme

growpart /dev/nvme1n1 1

03

Step 4

(Optional) To verify that the partition reflects the increased volume size, use the lsblk command again.

docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html#extend-file-system-nvme

04

Step 5

To verify the size of the file system for each volume, use the df -h command.

docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html#extend-file-system-nvme
06

Step 6

[ext4 file system] To extend the file system on each volume, use the resize2fs command

docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html#extend-file-system-nvme

resize2fs /dev/nvme1n1p1

05

Step 7

(Optional) To verify that each file system reflects the increased volume size, use the df -h command again.

docs.aws.amazon.com/AWSEC2/latest/UserGuide/recognize-expanded-volume-linux.html#extend-file-system-nvme
08