2

I'm rephrasing the question here because there are others that answer the question of how to resize an active partition, but perhaps this will help someone running a VM.

I set up a 20.04 VM under Fusion and started compiling something, which failed because it ran out of disk space.

So after resizing the virtual storage of the VM in Fusion, I restarted Ubuntu and went into Disks to expand the root volume into the new free space. But after I was prompted to authenticate for the resize, nothing happened. No error message, but no progress or change either.

So the question is how to resize the active partition in a VM.

enter image description here

Oscar Goldman
  • 123
  • 1
  • 5
  • You cannot operate on a mounted partition. – Organic Marble Nov 06 '21 at 02:31
  • Does this answer your question? How to resize partitions? – N0rbert Nov 06 '21 at 06:57
  • Thanks for those replies. Unfortunately I don't know how I'd perform the suggested procedure (which involved booting from a CD) on a VM. – Oscar Goldman Nov 06 '21 at 07:36
  • 2
    I’m not familiar with Fusion but I’d expect it to be similar to Virtualbox where you would: 1. Add a virtual CD-ROM drive to the machine. 2. Download the GParted iso. 3. Insert the GParted iso into the virtual CD-ROM. 4. Boot the VM telling it to boot from the virtual CD-ROM rather than the hard drive. 5. Use GParted to resize your partitions – PonJar Nov 06 '21 at 09:24
  • @PonJar Good suggestion, thanks! – Oscar Goldman Nov 06 '21 at 18:42
  • 1
    @PonJar I tried that and it appears to have worked fine. I rephrased the question to make it VM-specific, so if you'd like to post your solution I'll mark it as the answer. Thanks! – Oscar Goldman Nov 06 '21 at 21:09
  • I see the issue. You can't resize a loaded drive, but, as it is a VM, it is not "there" if it isn't loaded. The way to resize depends on the hppervisor software (i.e. Qemu, KVM, etc.) Most programs that let you create and run VM instances will also let you resize them. This is where you will find your answer. – Nate T Nov 07 '21 at 07:40

2 Answers2

3

I’m not familiar with Fusion but I’d expect it to be similar to Virtualbox where you would:

  1. Add a virtual CD-ROM drive to the machine.
  2. Download the GParted iso.
  3. Insert the GParted iso into the virtual CD-ROM.
  4. Boot the VM telling it to boot from the virtual CD-ROM rather than the hard drive.
  5. Use GParted to resize your partitions
PonJar
  • 1,868
  • 1
    Sry, I didn't notice that you posted an answer, or I would have waited until yours was accepted before posting. I think I may have loaded the page just before you posted. Or maybe I'm just blind. Either way, just know that it wasn't intentional. @OP accept this answer if you accept any. – Nate T Nov 07 '21 at 07:52
  • @NateT No problem. As I said I’m not familiar with Fusion and I would say your answer is probably the better and quicker solution so it adds value. – PonJar Nov 07 '21 at 08:22
2

As I said in my comment, you will need to do this inside of the hypervisor program on which the VM runs. Below, I have included instructions on how to do it in fusion (taken from the VMWare website):

  • Open Fusion.
  • Select the virtual machine in the Virtual Machine Library.
  • Go to Virtual Machine > Settings....
  • Click Hard Disk(s).
  • Use the slider to adjust the size of the virtual disk.
  • Click Apply.
Nate T
  • 1,524
  • Thanks for the reply; it's useful to inform people of the first step. But as I mentioned in the post, I had already resized the virtual disk. You still need to resize the boot partition to fill the added space, and this can't be done by Ubuntu's "Disks" utility. So after doing what you suggest, one must also use PonJar's procedure. – Oscar Goldman Nov 12 '21 at 20:00