Expanding disk inside Hyper-V using LVM

发布时间 2023-10-18 16:17:27作者: ChrainY

based on https://askubuntu.com/questions/646183/expanding-disk-inside-hyper-v-using-lvm#:~:text=First%2C expand the virtual disk," then "Expand").&text=Next%2C%20run%20parted%20and%20choose%20p%20for%20print%20.

and chatgpt.

parted /dev/sda

parted /dev/sda

GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
Warning: Not all of the space available to /dev/sda appears to be used, you can fix the GPT to use all of the space (an
extra 69206016 blocks) or continue with the current setting?
Fix/Ignore? Fix
Model: Msft Virtual Disk (scsi)
Disk /dev/sda: 172GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags
1 1049kB 538MB 537MB fat32 boot, esp
2 538MB 1612MB 1074MB ext4
3 1612MB 136GB 135GB

(parted) resizepart 3 100%
(parted) p
Model: Msft Virtual Disk (scsi)
Disk /dev/sda: 172GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags
1 1049kB 538MB 537MB fat32 boot, esp
2 538MB 1612MB 1074MB ext4
3 1612MB 172GB 170GB

(parted) quit

sudo resize2fs /dev/sda3