Resizing partition fdisk fails with invalid argument

Bar*_*lle 10 partition fdisk arch-linux gpt

I recently resized a VPS from a 50GB SSD to a 300GB SSD through my hoster's control panel. I now am trying to resize my main partition with fdisk to be able to use all the new space. However, fdisk gives me a warning upon starting:

GPT PMBR size mismatch (104857599 != 629145599) will be corrected by w(rite).
GPT PMBR size mismatch (104857599 != 629145599) will be corrected by w(rite).
Run Code Online (Sandbox Code Playgroud)

It seems obvious that it's a sixfold of the previous size, as I went from 50GB to 300GB. So, I decide to follow the hint and write the table...

Command (m for help): w
GPT PMBR size mismatch (104857599 != 629145599) will be corrected by w(rite).
fdisk: failed to write disklabel: Invalid argument
Run Code Online (Sandbox Code Playgroud)

.. which does not work. I can't find what causes that error anywhere despite many search queries. I do not use LVM and my partition table looks like:

Disk /dev/vda: 300 GiB, 322122547200 bytes, 629145600 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
Disklabel type: gpt
Disk identifier: 30D92031-0C13-42FF-AC16-D34F36DD3907

Device        Start       End  Sectors Size Type
/dev/vda1      2048     32767    30720  15M BIOS boot
/dev/vda2     32768  16809983 16777216   8G Linux swap
/dev/vda3  16809984 104857566 88047583  42G Linux filesystem
Run Code Online (Sandbox Code Playgroud)

Notice how the disk shows it as 300GiB, so it does recognize the size change.

Bar*_*lle 19

我设法很简单地解决了这个问题。我安装了 parted,当我运行时,它告诉我分区表没有覆盖整个磁盘(废话),所以它问我Fix/Cancel,我用Fix. 显然,这可以解决问题,因为我能够使用 将分区修改为完整大小sudo fdisk /dev/vda,但之后我确实需要运行sudo resize2fs /dev/vda3才能应用更改。