I am attempting to use "growpart" to grow a partition on a vm that is using LVM. The command reports successfully, and seems to output the correct changes. Though, nothing happens after running, and the partition is not changed even after a restart.
I am attempting to expand partition 5(lvm) on /dev/sda with the 42g from the current 32g
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 42G 0 disk
├─sda1 8:1 0 487M 0 part /boot
├─sda2 8:2 0 1K 0 part
└─sda5 8:5 0 31.5G 0 part
├─debian--vg-root 254:0 0 30.5G 0 lvm /
└─debian--vg-swap_1 254:1 0 976M 0 lvm [SWAP]
sr0 11:0 1 1024M 0 rom
$ fdisk -l
Disk /dev/sda: 42 GiB, 45097156608 bytes, 88080384 sectors
Disk model: QEMU HARDDISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x3991920e
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 999423 997376 487M 83 Linux
/dev/sda2 1001470 67106815 66105346 31.5G 5 Extended
/dev/sda5 1001472 67106815 66105344 31.5G 8e Linux LVM
Disk /dev/mapper/debian--vg-root: 30.5 GiB, 32774291456 bytes, 64012288 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/debian--vg-swap_1: 976 MiB, 1023410176 bytes, 1998848 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Now, using growpart to dry-run than grow the partition, which you can see the end block changed from 66105344
to 87078879
on partition 5
$ sudo growpart -N /dev/sda 5
CHANGE: partition=5 start=1001472 old: size=66105344 end=67106816 new: size=87078879,end=88080351
# === old sfdisk -d ===
label: dos
label-id: 0x3991920e
device: /dev/sda
unit: sectors
/dev/sda1 : start= 2048, size= 997376, type=83, bootable
/dev/sda2 : start= 1001470, size= 66105346, type=5
/dev/sda5 : start= 1001472, size= 66105344, type=8e
# === new sfdisk -d ===
label: dos
label-id: 0x3991920e
device: /dev/sda
unit: sectors
/dev/sda1 : start= 2048, size= 997376, type=83, bootable
/dev/sda2 : start= 1001470, size= 66105346, type=5
/dev/sda5 : start= 1001472, size= 87078879, type=8e
$ sudo growpart /dev/sda 5
CHANGED: partition=5 start=1001472 old: size=66105344 end=67106816 new: size=87078879,end=88080351
Now I would expect the lsblk to show the expanded size, but nothing has changed. Not sure whats going on to be honest, and its the same after a restart
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 42G 0 disk
├─sda1 8:1 0 487M 0 part /boot
├─sda2 8:2 0 1K 0 part
└─sda5 8:5 0 31.5G 0 part
├─debian--vg-root 254:0 0 30.5G 0 lvm /
└─debian--vg-swap_1 254:1 0 976M 0 lvm [SWAP]
sr0