Does the VM have any Snapshots?
From a VMware KB...
Shrinking the virtual disk in a Linux virtual machine
To shrink the virtual disk in a Linux virtual machine:
- Open Terminal.
- Run these commands:
/usr/bin$ vmware-toolbox-cmd help disk
Before running the command above you need to first install VMware Tools. You have not stated whether you have or not. If f you have not, if you are using Ubuntu, in the VM, run $sudo apt-get install build-essential. Then go to the VM tab and select Install VMware Tools, There are instructions on how to install the tools, and you should know how to use the Help system. However I'm not sure they are completely up to date (but confess I haven't checked) This is what I do. First run $sudo mount. You will see where the Tools are mounted so you don't need to manually mount /dev/sr0 /media/cdrom. Navigate to the to "VMwre Tools" direcotry. Then follow the instructions in the Help documentation (cp .../"Vmware Tools"/* /tmp etc etc) After a successful compile of the Tools run the above command /usr/bin/vmware-toolbox-cmd help disk as stated It will display the disk options so run /usr/bin/vmware-toolbox-cmd [OPTION] to shrink the disk. Normally you will want to shrink the root (/) directory.
No snapshots are visible in the snapshot manager.
VMware tools are installed with a current version.
The command vmware-toolbox-cmd help disk works and talks about shrink, shrinkonly and wipe, but doesn't really describe the difference between them. Shrink sounds pretty benign, but wipe makes me nervous.
Can you clarify the difference? Sorry if it exists in the docs but I've had a hard time finding docs for this operation.
In this context "wipe" is nothing to be worried about as it only wipes space not occupied by existing files thus allowing greater shrinkage. In other words, it zeroes out once used space that now only contains the digital remains of deleted files. A wipe is automatically done when using "shrink" and not when using "shrinkonly".
So the command vmware-toolbox-cmd returns the following;
[root@zslg002 bin]# ./vmware-toolbox-cmd disk list
Shrink disk is disabled for this virtual machine.
Shrinking is disabled for linked clones, parents of linked clones,
pre-allocated disks, snapshots, or due to other factors.
See the User's manual for more information.
There is not a large single file in the VMware directory for this machine, so the filesystem is definitely spread across multiple vmdk files.
Not sure where to go from here. Are there man pages for vmware tools? I searched the and couldn't find them.
Need to see the vmware.log file of the VM and a directory listing of the files that comprise the VM using the following command in a Command Prompt changed to the VM's directory or a screen shot showing filename, file size and date/time stamp.
dir *.* /one > filelist.txt
Then attach the files to reply.
Note: Use the "Use advanced editor" link in the upper right corner of the normal reply window to bring up the Advanced Editor where you'll be able to attach files via the Choose File button or Browse button (depending on the Browser) above the Post Message button!
According to info in the filelist.txt and in the vmware.log file the VM has a Snapshot and if it doesn't show in the Snapshot Manager then it's orphaned. You might be able to recover by taking and then immediately deleting another Snapshot and do this while the VM is shutdown, not suspended. Make sure you have a proper backup before doing anything!
Well deleting the snapshot solved it.
I wasn't sure if I had snapshots or not when I started trying to sort through this, so I made one just to see what files it created. After deleting the vmware-toolbox-cmd worked as advertised. Nice improvments to disk usage in the VM directory.
Presumably this same operation would be needed as the filesystem become 'fragmented' across multiple .vmdk files with use.
Thanks alot for the help.