How do I resize the partition of my guest Ubuntu OS in a VMware Fusion VM?

7,764

Boot the VM from the live CD, use the partition editor to expand the partition, disconnect the CD and reboot.

Share:
7,764

Related videos on Youtube

Daryl Spitzer
Author by

Daryl Spitzer

Father of three, husband, computer programmer (Pythonista), skeptic, atheist, podcast listener, baseball fan, Canadian (in the United States).

Updated on September 17, 2022

Comments

  • Daryl Spitzer
    Daryl Spitzer over 1 year

    I'm running Ubuntu 8.04 in a VM in VMware Fusion 3.0. I understand how to resize the hard disk (Fusion makes that easy with a GUI). But how do I resize the partition in Ubuntu?

    mount -l tells me: "/dev/sda1 on / type ext3 (rw,relatime,errors=remount-ro) []".

    I found Ubuntu: Resize the root LVM(2?) partition, which led me to read the man page for resize2fs, which says I should use lvextend to expand the size of the underlying partition. But Ubuntu: Resize the root LVM(2?) partition talks about pvresize and lvresize. Which should I use? Any other advice?

  • Daryl Spitzer
    Daryl Spitzer over 14 years
    Would the "live CD" be the Ubunto 8.04 ISO I used to make the VM? How do I boot from the CD? (I don't see any topics related to that in the VMware Fusion help.)
  • Chopper3
    Chopper3 over 14 years
    In the VM's setting set the virtual CD drive to point to either the real live CD or the image .ISO file (depending on which you used), make sure it's set to boot from CD in Advanced Settings.
  • Jim Zajkowski
    Jim Zajkowski over 14 years
    If this VM has a swap partition, it's possible that that it is after sda1, and you will have a lot of work to resize it. In VMware you can press Escape while the VM is booting to get a boot menu as well, but you have literally under a second to press it.
  • Chopper3
    Chopper3 over 14 years
    Actually it's easier than you'd think, you just move the swap partition to the end of the drive/expanded-disk and then grow the main partition into the space that's been freed up. In fact I just did it and it took less than ten minutes. Oh and I know we're talking about Fusion here but in ESX you can force going into the boot menu on a VM-by-VM basis via advanced settings, thought you'd like to know.
  • Jim Zajkowski
    Jim Zajkowski over 14 years
    On ESX I just turn up the boot delay to 2000 millisecs.