How to resize a VM hard drive - Oliver-Mustoe/Oliver-Mustoe-Tech-Journal GitHub Wiki

Taken from:

  1. https://askubuntu.com/questions/116351/increase-partition-size-on-which-ubuntu-is-installed
  2. https://ostechnix.com/resize-lvm-partitions-linux/
  3. https://packetpushers.net/ubuntu-extend-your-default-lvm-space/ - need to add steps from this!

The following describes in short detail how to resize a VM in VMware:

  1. Resize the VM in the VM options

  2. Inside the system, use cfdisk to resize the root partition (type should be Linux filesystem) to the size desired

    1. The command df -h can be used to find the root aka / partition
    2. MUST THEN REBBOT THE SYSTEM
  3. Then run the command

    resize2fs <ROOT PARTITION DEVICE NAME>

To resize the partition!


To resize a lvm parition, make sure the pool has enough space (using cfdisk like above) and resize the lvm partition with:

sudo lvextend -L +<AMOUNT>G /dev/<lvm_partition_path>

And then use resize2fs to use the space!

⚠️ **GitHub.com Fallback** ⚠️