Proxmox Ubuntu VM doesn’t utilize whole disk Space

Ubuntu VM hosted on my Promox server wasn’t utilizing all the allocated disk space. The following commands helped.

pvresize /dev/mapper/ubuntu--vg-ubuntu--lv /dev/sda3

Purpose: This command is used to resize a Physical Volume (PV) that belongs to a Volume Group (VG).

What it does: It extends the physical volume to utilize the available space on the specified partition (/dev/sda3). This ensures that all the space in the partition is made available to the VG (in this case, ubuntu--vg).

lvresize /dev/ubuntu-vg/ubuntu-lv /dev/sda3

Purpose: This command is used to resize a Logical Volume (LV), typically to increase or reduce its size.

What it does: It attempts to resize the logical volume /dev/ubuntu-vg/ubuntu-lv

resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
  • Purpose: This command resizes the filesystem on a logical volume.
  • What it does: It extends or reduces the filesystem on /dev/mapper/ubuntu--vg-ubuntu--lv to match the current size of the logical volume.
    • If the logical volume was increased in size, resize2fs makes the filesystem grow to use the newly available space.
    • If it was reduced, it shrinks the filesystem to the new size.

This command is crucial after resizing the logical volume to ensure that the filesystem can utilize the new space.

Tags: No tags

Add a Comment

Your email address will not be published. Required fields are marked *