jueves, 27 de marzo de 2025

How To Expand Ubuntu Filesystem Volume on Hyper-V

 

Steps:

  1. Expand the VDHX file via Hyper-V as mentioned in existing solutions and then inside the VM:

  2. fdisk -l

    See which partition is the current Ubuntu setup - should be obvious based on size (in my case was sda3)

  3. growpart /dev/sda 3

    Note the space as mentioned.

  4. pvresize /dev/sda3

    This is the step which isn't mentioned in a lot of places; its the intemediate step that allows the logical volume extension step work.

  5. lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv

    The /dev/ part can seen in the fdisk output from step 1.

  6. resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv

    After the prep above, this step now works. Takes a couple of moments and afterwards can verify with df -h that the partition is expanded.

No hay comentarios:

Publicar un comentario