Shrink VHDX for Linux VM
Shrinking the VHDX size may corrupt the GPT table, causing the VM to fail to boot.
As a result, VHDX shrinking should only be performed while the VM is powered on. Additionally, Hyper-V can only shrink a VHDX if there are no checkpoints.
sudo gdisk /dev/sda
:::spoiler
GPT fdisk (gdisk) version 1.0.7
Warning! Disk size is smaller than the main header indicates! Loading
secondary header from the last sector of the disk! You should use 'v' to