Skip to content

Instantly share code, notes, and snippets.

@dariahervieux
Last active November 5, 2023 10:20
Show Gist options
  • Save dariahervieux/6429274299617e57950a5613f7145d9d to your computer and use it in GitHub Desktop.
Save dariahervieux/6429274299617e57950a5613f7145d9d to your computer and use it in GitHub Desktop.
Hyper-V cheat-sheet

Hyper-V Cheat-sheet

Working with virtual disks

Expand the virtual disk

You can expand Virtual Disk via Hyper-V UI.

After the expantion, the guest OS might not take the expantion into account.

Fix disk size on Ubuntu

Check disk partitions : sudo fdisk -l

If there is an error like the following : "GPT PMBR size mismatch", you need to fix the disk size by expanding the partition to the free size:

# install growpart
sudo apt install cloud-guest-utils
# expand sda1 partition into the free space
sudo growpart /dev/sda 1
# resize
sudo resize2fs /dev/sda1

Credits : https://linguist.is/2020/08/12/expand-ubuntu-disk-after-hyper-v-quick-create/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment