Increase the Partition Size Ubuntu VM

Step 1: Increase the Disk Size in VMware

  1. Power off the VM:
    • Ensure the virtual machine is powered off.
  2. Increase the virtual disk size:
    • Open VMware Workstation or VMware Player.
    • Right-click on your virtual machine and select Settings.
    • Select the Hard Disk (SCSI or IDE) you want to expand.
    • Click on the Utilities button and select Expand.
    • Enter the new maximum disk size and click Expand.

Step 2: Resize the Physical Volume

  1. Resize the Physical Volume:
    sudo pvresize /dev/sda3
    

Step 3: Extend the Logical Volume

  1. Extend the Logical Volume:
    sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
    

Step 4: Resize the Filesystem

  1. Resize the Filesystem:
    sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
    

Verify the Changes

  1. Check the Disk Space:
    df -h
    

These steps should help you resize the partition and extend the logical volume using command-line tools on an Ubuntu Server.


RyanX October 29, 2024
Share this post
Tags
Archive