How To Shrink Redhat Linux VMware Virtual Disk Files (.vmdk)

Discussion in 'HOWTO-Related Questions' started by pmcglauchlin, May 14, 2010.

  1. pmcglauchlin

    pmcglauchlin New Member

    Hi,

    I found the following recommended actions to shrink Redhat Linux VMware Images:

    1) replace all empty bytes on hard drive with zeros:

    dd if=/dev/zero of=/0bits bs=20971520 # bs=20m rm /0bits

    Note: saw this optional version on this forum:

    cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill


    Finally, use the VMware Disk Manager Utility (located in the VMware Workstation install) to shrink the file system:

    "C:\Program Files\VMware\VMware Workstation\vmware-vdiskmanager.exe" -k "F:\VMware Images\OEL SOA Suite 11.1.1.3\OEL5U3_11gSOA_2.vmdk"


    Now that I have completed the two steps I cannot log in to the GUI using my user id - "oracle".

    I get a GDM error and a look at the file system shows that the server has zero space.

    When i look in VMware it shows 50% space available on the hard drive but zero space when inside the image.

    I've tried a number of solutions including emptying the tmp file, removing files from user, etc.

    Ideas?

    Phil.dd if=/dev/zero of=/0bits bs=20971520 # bs=20m rm /0bits


    cat /dev/zero > zero.fill;sync;sleep 1;sync;rm -f zero.fill

    Finally, use the VMware Disk Manager Utility (located in the VMware Workstation install) to shrink the file system:

    "C:\Program Files\VMware\VMware Workstation\vmware-vdiskmanager.exe" -k "F:\VMware Images\OEL SOA Suite 11.1.1.3\OEL5U3_11gSOA_2.vmdk"
     
  2. falko

    falko Super Moderator Howtoforge Staff

Share This Page