3

I have already increased the size by going into VMWARE Workstation settings ->Hardisk to 34GB. But I cant able to relocate it inside the Ubunto running inside the VMware.

I want to increase the size of /dev/sda1

enter image description here

4 Answers 4

8

I faced the same problem and fixed it using gparted.

After increasing the size by going into VMWARE Workstation settings -> Hardisk,

  • Run your Virtual Machine.
  • Open Terminal
  • Install gparted

sudo apt-get install gparted

  • After installation, open gparted enter image description here

  • You will see the space unallocated(1), this is the space that you indicated in your vmware workstation settings (5GB in my case) enter image description here

  • Select your existing partition(1), then click the Resize/Move icon(2). enter image description here

  • Simply, move the resize handle up to your desired new size(1), click Resize(2). enter image description here

  • Do not forget to click the Check icon to Apply all operation made. enter image description here

  • and that's it! You have expanded your VM HD Size.

Try it out, the app's ui made it easier to use. I used this method in my VMWare Workstation for Ubuntu 18.04. (might work as well with Ubuntu 20.x)

3
  • 1
    For me this is not working. Despite the space showing up as unallocated as expected, after selecting the existing partition and clicking Resize/Move, the space cannot be allocated. Minimum size and maximum size show the same value.
    – foss
    Apr 7, 2022 at 12:10
  • 1
    Thanks so much. I had to unmount the disk to increase the unalocated spaced. It worked Nov 1, 2022 at 21:18
  • 1
    Sometimes the GUI approach beats the CLI approach. The check icon looked slightly different in v1.2.0. Thank you! Feb 4 at 18:53
3

How to expand hard disk size using VMware:

To increase the virtual disk from the command line:

  1. Open a command prompt. For more information, see how to open command prompt.
  2. Navigate to the product's installation directory. See how to do that
  3. Type vmware-vdiskmanager -x 100Gb vm.vmdk and press Enter(Replace 100Gb with the actual size of virtual disk that you want. You can also specify Kb and Mb.)
  4. Follow this

And, I guess you've tried this(from GUI):

  1. Select the virtual machine from the Inventory.
  2. Click Edit Virtual Machine Settings.
  3. Click Hard Disk.
  4. Click Utilities > Expand, enter the new size, then click Expand.
  5. Again, follow this one

How to expand hard disk size inside Ubuntu(using gparted tool):

What about expanding inside Ubuntu, I guess you should try gparted or similar tool. How to do that, go here

To open gparted do the following:

  1. Install it by typing sudo apt-get install gparted
  2. Run it by pressing Alt+F2, and type there gparted
0

Note: To edit the hard disk size we must remove existing snapshots, so be careful

First, remove any existing snapshots and edit the Hard disk size and launch the VM

COMMANDS

Run below commands as ROOT user

$ fdisk -l
$ gparted 

=> Select the File System 'linux-swap' and click on 'Swapoff'

=> Select the File System 'extended' then do right click and select 'resize/move' and drag the right arrow to full-right, then click 'resize/move'

=> Select the File System 'linux-swap' then do right click and select 'resize/move' and drag the left-and-right symbol to full-right, then click 'resize/move' and click 'OK'

=> Select the File System 'extended' then do right click and select 'resize/move' and drag the left arrow to full-right and select Align to 'Cylinder' from drop-down menu, then click 'resize/move'

=> Select the File System 'ext4' then do right click and select 'resize/move' and drag the right arrow to full-right, then click 'Resize'

=> Then either click on 'check symbol' or go to edit and select 'Apply All Operations' then click 'Apply ' and 'Close' (Ignore warnings)

$ reboot
$ fdisk -l

References

https://www.youtube.com/watch?v=NwpzYlfKnrY

https://www.techrepublic.com/article/extending-partitions-on-linux-vmware-virtual-machines/

https://communities.vmware.com/t5/Virtual-Machine-Guest-OS-and-VM/Complete-Guide-How-to-Increase-space-on-Linux-vmware/td-p/388872

0

Use gparted , watch some videos or check some link. And restart the VM

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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