1

I'm using vmware and want to add space to a VM without shutting down the system by simply adding space to the existing drive. How can I accomplish that?

2
  1. In the VMWare consore, extend the drive
  2. Use fdisk or cfdisk or parted to create a new primary partition with type 8e/lvm (we'll call it /dev/sda3 for now)
  3. Tell the system about the new partition: sudo partprobe /dev/sda3
  4. Make the new partition an lvm physical volume: sudo pvcreate /dev/sda3
  5. Add the new physical volume to your volume group: sudo vgextend $VGName /dev/sda3
  6. Increase the size of your logical volume: sudo lvextend -L+10G /dev/$VGName/root
  7. Increase the size of your file system: sudo resize2fs /dev/$VGName/root

It may be easier to simply add additional drives to the VM and use them as physical volumes. That would clutter the VM storage area with more VMDKs. This solution is a bit messier in the vm.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.