I knew it! But it didn’t works. You can see my post that show the fdisk or parted is right. But the mount point still mount 2GB. not take all of 20GB .
It’s not enough to just modify the volume size and the partition table, you also need to extend the filesystem with resize2fs. See the link in the post @tomcat667 provided you.
Already did it. No can do to extend the disk size. BTW, the disk image is that I install kvm vm with vyos 1.3.3.iso. then I backup it with dd command, after that I use dd to restore to another kvm host. at last I can’t extend the disk capcity.
I’ve tried this on a VM and it works fine for me. I start with a fresh 1.3.3 install on a 3G storage. I then extended the storage to 6G. Once I’ve done that, fdisk notices the discrepancy between the physical device bounds and the partition table:
root@vyos:~# fdisk /dev/sda
Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
GPT PMBR size mismatch (6291455 != 12435455) will be corrected by write.
The backup GPT table is not on the end of the device. This problem will be corrected by write.
Command (m for help): p
Disk /dev/sda: 6 GiB, 6366953472 bytes, 12435456 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: E4FA32A3-8E32-41AE-8151-8D4D1A7BDC6D
Device Start End Sectors Size Type
/dev/sda1 34 2047 2014 1007K BIOS boot
/dev/sda2 2048 526335 524288 256M EFI System
/dev/sda3 526336 6291422 5765087 2.8G Linux filesystem
I deleted the root partition and created a new one that extends to the end of the disk:
Disk /dev/sda: 6 GiB, 6366953472 bytes, 12435456 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: E4FA32A3-8E32-41AE-8151-8D4D1A7BDC6D
Device Start End Sectors Size Type
/dev/sda1 34 2047 2014 1007K BIOS boot
/dev/sda2 2048 526335 524288 256M EFI System
/dev/sda3 526336 12435422 11909087 5.7G Linux filesystem