growpart fails with “NOCHANGE: partition 2 is size 61888512. it cannot be grown”

Trying to extend partition fails with following error:

# growpart /dev/vda 2
NOCHANGE: partition 2 is size 61888512. it cannot be grown

Check the partion

# fdisk -l /dev/vda

Disk /dev/vda: 137.4 GB, 137438953472 bytes, 268435456 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x000cbbd2

Device Boot Start End Blocks Id System
/dev/vda1 * 2048 1026047 512000 83 Linux
/dev/vda2 1026048 62914559 30944256 83 Linux
/dev/vda3 62914560 134217727 35651584 82 Linux swap / Solaris

You can see /dev/vda consists of 3 partitions.

You can extend only the last partition (/dev/vda3 here). As you are trying to grow partition 2 (/dev/vda2), this is an expected behaviour.

You can consider moving the swap space (/dev/vda3) to any other new disk, then delete /dev/vda3 and then extend /dev/vda2.