Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Ubuntu 9.04 in vmware for my programming purpose. I previously had 12GB of virtual harddisk, my partition scheme was as follows,


8GB Primary Partition for (/)

2GB logical extended partition for home

2GB logical extended partition for swap


Now I need 20 GB more space for my (/) Partition. So I added 20GB to my virtual harddisk so now, my partition scheme was as follows,


8GB Primary Partition for (/)

2GB logical extended partition for home

2GB logical extended partition for swap

20GB unpartotioned space.


can you please tell me is it possible to make my Primary partition (/) to 28 GB, If yes tell me how?

It would be great if you can tell me some GUI software, otherwise for commandline please elaborate little more. :)

Thanks.

share|improve this question
up vote 2 down vote accepted

You can increase the size of the virtual machine's disk capacity with the command-line tools provided with VMWare:

/usr/bin/vmware-vdiskmanager -x 28GB /path/to/VM_Name.vmdk

replacing /path/to/VM_Name.vmdk with the path & name of your virtual disk file.

Then, increase the virtual disk with a GParted bootable ISO (boot from it with the VM).

Full guide found here.

share|improve this answer
    
Thanks you very much for your answer John T. I have one question that is there are two extended logical partitions between free space and / partition, How can I join first and last partition. – SunnyShah Oct 21 '09 at 18:59
    
You can move the partitions and then merge them with the partition you want to expand. – John T Oct 21 '09 at 19:18
    
Thanks, Just trying that. – SunnyShah Oct 21 '09 at 19:21
    
It worked. Downloaded GParted bootable iso, moved other partitions. increase size of root partition. Thank you very much for introducing me to such a useful tool. – SunnyShah Oct 21 '09 at 21:18

Move /home and /swap to separate virtual disks (VMDKs). There's no reason to keep them on the same VMDK; virtual disks aren't a scarce resource!

This also gives you a bit more flexibility -- you can put /home and /swap on different storage, for example.

You will need to edit /etc/fstab to change the lines for /home and /swap to point at the new disks. If you look at /etc/fstab, you will see lines like

/dev/sda2     /home   ext3   (various options)
/dev/sda3     none    swap   (various options)

If you move /home to disk #2 and swap to disk #3, change /dev/sda2 to /dev/sdb1 and /dev/sda3 to /dev/sdc1.

Note that if you used LVM for your disks you would not have this problem; LVM logical volumes do not need to be contiguous on disk (or even on the same disk!)

share|improve this answer
    
Upvoted for mentioning LVM. – Joe Internet Oct 21 '09 at 20:44
    
This would have been "Switch to LVM" if it weren't for this being a VM. For a VM this is better than LVM. – Captain Segfault Oct 21 '09 at 23:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .