First you need to locate vmdisk.img file.
Then run this command: qemu-img resize vdisk1.img +5G. This add 5gb more space.
Then inside that virtual machine...
- Extend the physical drive partition:
sudo fdisk /dev/vda
– Enter the fdisk tool to modify /dev/vda
NOTE: End each one letter command by pressing [Enter]; if the instructions do not specify a specific response to a question, just press [Enter] to accept the defaultp
– p command prints the disk info, same as runningfdisk -l /dev/vda
d
– d command delete the last partition (in this case, /dev/vda1)n
e
n command creates a new partition; e makes that an extended partitiont
– t changes the type of partition8e
– Enter 8e (lvm) as the partition type
NOTE: In some cases the disk uses GPT signature rather than DOS. In that case, use the31
(lvm) as the partition typew
– w writes the changes to disk and exits fdisk
- Modify (extend) the LVM:
- Tell LVM the physical partition size has changed:
sudo pvresize /dev/vda1
- Find the actual path of the LVM logical volume:
sudo lvdisplay
– The LV Path is value needed - Tell LVM to extend the logical volume to use all of the new partition size:
sudo lvextend -l +100%FREE /dev/COMPbase-vg/root
– Using the LV Path from above
- Tell LVM the physical partition size has changed:
- Resize the file system:
sudo resize2fs /dev/COMPbase-vg/root