'error when resizing partition using `growpart` on AWS EBS instance

I have an EC2 instance where I'm attempting to resize the disk on the fly. I've followed the instructions in this SO post but when I run sudo growpart /dev/nvme0n1p1 1, I get the following error:

FAILED: failed to get start and end for /dev/nvme0n1p11 in /dev/nvme0n1p1

What does this mean and how can I resolve it?


More info:

Output from lsblk:

NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
nvme0n1     259:0    0   300G  0 disk
└─nvme0n1p1 259:1    0   300G  0 part /

I can see that EBS volume is in the in-use (optimizing) state.

Thanks in advance!



Solution 1:[1]

But for me the solution didn’t work

 NAME     MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT

xvda 202:0 0 8G 0 disk ??xvda1 202:1 0 8G 0 part / xvdf 202:80 0 280G 0 disk ??xvdf1 202:81 0 4G 0 part [SWAP] ??xvdf2 202:82 0 10G 0 part /data1 ??xvdf3 202:83 0 10G 0 part /data2 ??xvdf4 202:84 0 1K 0 part ??xvdf5 202:85 0 10G 0 part /applications1 ??xvdf6 202:86 0 4G 0 part /applications2 ??xvdf7 202:87 0 8G 0 part /logsOld ??xvdf8 202:88 0 50G 0 part /extra ??xvdf9 202:89 0 20G 0 part /logs ??xvdf10 202:90 0 64G 0 part /extra/tmp

growpart /dev/xvdf 10

FAILED: failed to get start and end for /dev/xvdf10 in /dev/xvdf

enter image description here

Solution 2:[2]

I think the name of the command growpart is a bit misleading, because following the aws instructions you should grow the disk:

sudo growpart /dev/nvme0n1 1

not the partition /dev/nvme0n1p1

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 preetam singh
Solution 2 Christina A