How to force partition to value out of range

Solution 1:

Got it. This worked for me:

By launching sudo parted I was able to do unit s to switch to sectors, and p to see the current table, and mkpart logical 501760 41940991 to recreate the partition. And quit from parted. Then I ran sudo fdisk /dev/sda and used t to set the partition type back to 8e

Solution 2:

I get in the exact same situation. I wanted to extend an LVM partition of a virtual machine with the layout as shown in question (msdos style). While the author resolved it using parted instead of fdisk, it is also possible to do with fdisk.

I have found a solution here (so go there and upvote for the original answerer too). The problem is that you need to also resize /sda2, which is your "extended" partition that contains your sda5 logical partition.

After that, follow this article to grow lvm pv, lvm lv, and finally your fs.