| « HOWTO: Remove Windows Logon Wallpaper | Who is this Guy? » |
A common experience I have had and seen others need help with is the situation where you created one or more of your initial VMDK files too small. I always struggled with trying to create the smallest practical files for our expected needs. We don’t want to waste any of that precious SAN resource now, do we? There are so many reasons that can lead to needing more space. It is great when you find that you do have options other than recreating the whole install. There are variations on this information available elsewhere on the internet, however I spent what I felt was an excessive amount of time trying to find it and figure it out myself. Hopefully this will save someone else significant time and effort. I wanted the simplest procedure possible and I didn’t want to buy any software to get it done. Here is the procedure…
As with any operation of this type I would highly recommend doing a backup in case anything goes wrong. You will be making modifications to the raw VMDK files associated with your VM so take care!
Use this procedure to resize an existing Windows VMDK file when you need more space. It looks long because of all the screenshots, but only takes about 5 minutes. What you need:
This may be daunting if you are not experienced in Linux, but is still very easy if you follow these instructions.
cd /vmfs/volumes/VM-SCSI_OS_1/SVMesaApp01/
[root@smesavm1 SVMesaApp01]# ls -lah
total 8.1G
drwxr-xr-x 1 root root 2.1K Apr 25 06:05 .
drwxrwxrwt 1 root root 1.2K Apr 25 02:13 ..
-rw——- 1 root root 10.0G Apr 25 06:05 SVMesaApp01-flat.vmdk
-rw——- 1 root root 8.5K Apr 25 06:05 SVMesaApp01.nvram
-rw——- 1 root root 343 Apr 25 05:04 SVMesaApp01.vmdk
-rw——- 1 root root 0 Apr 25 02:15 SVMesaApp01.vmsd
-rwxr-xr-x 1 root root 1.3K Apr 25 06:07 SVMesaApp01.vmx
-rw——- 1 root root 255 Apr 25 06:07 SVMesaApp01.vmxf
-rw-r–r– 1 root root 21K Apr 25 02:13 vmware-4.log
-rw-r–r– 1 root root 27K Apr 25 02:13 vmware-5.log
-rw-r–r– 1 root root 27K Apr 25 02:13 vmware-6.log
-rw-r–r– 1 root root 22K Apr 25 02:13 vmware-7.log
-rw-r–r– 1 root root 30K Apr 25 02:13 vmware-8.log
-rw-r–r– 1 root root 27K Apr 25 02:13 vmware-9.log
-rw-r–r– 1 root root 52K Apr 25 06:05 vmware.log
YES - [root@smesavm1 SVMesaApp01]# /usr/sbin/vmkfstools -X 12G SVMesaApp01.vmdk
NO! - [root@smesavm1 SVMesaApp01]# /usr/sbin/vmkfstools -X 12G SVMesaApp01-flat.vmdk
[root@smesavm1 SVMesaApp01]# ls -lah
total 11G
drwxr-xr-x 1 root root 2.1K Apr 25 06:27 .
drwxrwxrwt 1 root root 1.2K Apr 25 02:13 ..
-rw——- 1 root root 12G Apr 25 06:05 SVMesaApp01-flat.vmdk
-rw——- 1 root root 8.5K Apr 25 06:05 SVMesaApp01.nvram
-rw——- 1 root root 343 Apr 25 06:27 SVMesaApp01.vmdk
-rw——- 1 root root 0 Apr 25 02:15 SVMesaApp01.vmsd
-rwxr-xr-x 1 root root 1.3K Apr 25 06:07 SVMesaApp01.vmx
-rw——- 1 root root 255 Apr 25 06:07 SVMesaApp01.vmxf
-rw-r–r– 1 root root 21K Apr 25 02:13 vmware-4.log
-rw-r–r– 1 root root 27K Apr 25 02:13 vmware-5.log
-rw-r–r– 1 root root 27K Apr 25 02:13 vmware-6.log
-rw-r–r– 1 root root 22K Apr 25 02:13 vmware-7.log
-rw-r–r– 1 root root 30K Apr 25 02:13 vmware-8.log
-rw-r–r– 1 root root 27K Apr 25 02:13 vmware-9.log
-rw-r–r– 1 root root 52K Apr 25 06:05 vmware.log
The scary part is done. The rest is easy…
NOTE: It is VERY easy to miss pressing ESC at the correct time during the VMWare VM BIOS POST routine. If you do miss pressing ESC then you need to let Windows reboot before trying again. Do not cycle power or otherwise disrupt the boot process because if you do, the next step will fail because the disk will be considered ‘dirty’. If you do it correctly you will be given the option to reboot from the CD-ROM Device.

I’m not sure why this is, but I with the version of GPartEd I was using for this I couldn’t get it to work properly if I didn’t do this step!




NOTE: If this process fails on the last stop you can expand the “Details” item repeatedly until you drill down the explanation of the error. The only problem that I have ever found here is the error caused when you try to reboot from the CD and miss the short window of time to press the “ESC” key (used to select the boot device on the BIOS post screen). If this happens and you reboot again without letting the Windows boot complete then the file system is considered ‘dirty’ and the resize may fail. If this happens then just reboot windows and try again.