VMware Communities
drnewman5
Contributor
Contributor

Reduce partition size?

VMware Fusion 3.0.1, OS X 10.6.2

How to reduce the size of a partition holding a Windows XP virtual machine?

VMware Fusion's settings dialog allows disk size to be only increased, not decreased.

This VM has a 50G disk where only ~16G is in use. VMware Tools successfully ran shrink. The open-source gparted tool successfully reduced the drive size to 24G (and the VM sees it as a 24G drive). However, neither vmware-vdiskmanager nor any other tool I've tried will reduce the disk allocation below the initial 50G.

Thanks in advance for any clues on recovering the unused space.

0 Kudos
2 Replies
rcardona2k
Immortal
Immortal

How to reduce the size of a partition holding a Windows XP virtual machine?

VMware Fusion's settings dialog allows disk size to be only increased, not decreased.

This VM has a 50G disk where only ~16G is in use. VMware Tools successfully ran shrink. The open-source gparted tool successfully reduced the drive size to 24G (and the VM sees it as a 24G drive). However, neither vmware-vdiskmanager nor any other tool I've tried will reduce the disk allocation below the initial 50G.

You're mixing some terms here (drive size and partition size). There is virtual disk capacity which can only be sized and increased by vmware-vdiskmanager, file system partition size which can be changed by gparted and the allocated size of the virtual hard disk file on your OS X host (affected by shrinking).

The maximum disk capacity (50G) in your case won't matter so long as you've shrunk the size of the virtual disk on the host to an acceptable level and resized the file system partition size to a lower high watermark, e.g. 24 GB. Changing the filesystem partition size effectively "caps" the new maximum file system usage. This in turn affects how much the virtual disk will occupy on the host, it should be close.

The optimal way to achieve this is:

defrag the filesystem (you can use "defrag c:" repeatedly)

Result: all allocated blocks will be moved to the front of the virtual hard disk

Shrink the virtual hard disk using VMware Tools

Result: the virtual hard disk should occupy on the host, close to same size of allocated space within the virtual filesystem

Decrease the file system partition size with gparted to a new lower maximum size

Result: the file system maximum allocated size will be capped at the new, lower maximum size

Outcome: the size of the virtual disk on the host will not exceed the filesystem maximum and you have the flexibility to raise the max, should you reach it. The only way to see the disk capacity will be in Window's disk manager or in properties of the disk in the Fusion UI.

Note: The only way to truly downsize the disk capacity is to create a second virtual disk and use a cloning tool like Clonezilla (also a live CD product), or tools such as Symantec Ghost, Acronis Trueimage to transfer the filesystem of the larger virtual disk to the smaller one. IMO, the steps above keep you from having to do this.

0 Kudos
ChipMcK
Hot Shot
Hot Shot

As rcardona2k points out, to change the Size/Allocation of the Virtual Disk you need to clone the existing one onto a smaller Virtual Disk.

I have used gparted's Copy/Paste of the Partitions for months for the clone operation successfully.

And I already have it available - at no additional cost (except time) - just a second Hard Disk to the VM (same type either IDE or SCSI - lsi/bus)

0 Kudos