Shrink Hard Disk (SCSI) in VMware Workstation?

kenw232

n00b
Joined
Nov 28, 2009
Messages
46
I have a VM that was about 120GB I wanted to migrate to a vSphere server. I had to reduce the amount to space used by the VM so it could fit so I did that - these first two screenshots show it was reduced to about 20GB on disk:
http://sites.extremehosting.ca/trash/space1.jpg
http://sites.extremehosting.ca/trash/space2.jpg

But the size of the VM's Hard Drive is still 120GB which won't fit onto my vSphere server. VMware Converter gives and error because of it:
http://sites.extremehosting.ca/trash/space4.jpg

How do I resize this 120GB Hard Drive down to about 30GB so I can get it moved to vSphere?
http://sites.extremehosting.ca/trash/space3.jpg
 
I have a VM that was about 120GB I wanted to migrate to a vSphere server. I had to reduce the amount to space used by the VM so it could fit so I did that - these first two screenshots show it was reduced to about 20GB on disk:
http://sites.extremehosting.ca/trash/space1.jpg

20GB is the filesystem size. Give us the size of the partitions/disk inside the VM:

Code:
Example:

# fdisk -l /dev/sda

Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00026e86

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048    41943039    20458496   8e  Linux LVM
 
Okay, you've cleaned the disk already.
You've managed the partition.

Shut down the VM.
Open up the VM Properties and go to the Disk (should work IDE/SCSI).
ShrinkVMWareDisk.png

Compact.

Note: Will take a while.
 
D'oh.

Add a second drive of the right size. Boot off of a livecd and clone the bigger drive to the smaller. You may have to reinstall the boot blocks.
 
D'oh.

Add a second drive of the right size. Boot off of a livecd and clone the bigger drive to the smaller. You may have to reinstall the boot blocks.

Thanks, this worked. Was a pain to get it to boot, LILO kept giving some checksum error. Had to get a boot-repair-cd, then also drop to a shell and "sudo chroot /mnt/sda lilo" to redo lilo. Was find after that.
 
Cool. Glad you were able to get it worked out!
 
Back
Top