10 Replies Latest reply on Dec 16, 2013 2:20 PM by ski6jones

    Linux virtual system won't shrink in Workstation 9.03

    ski6jones Lurker

      I have Workstation 9.03 running on Win7, and a Linux virtual machine.

       

      The filesystems in Linux are about 130 GB, but the total space used in Linux is approximately 45 GB.

       

      The virtual machine directory for Linux is currently about 90 GB.   The file systems are not preallocated and are composed of multiple vmdk files.

       

      I have tried the Defrag and Compact utilities to reduce the overal size of the Linux VM directory, but no joy.

       

      Can anyone help me with this?  I've been around unix for a while, but new to VMware Workstation.

       

      Thanks,

       

      Carl

        • 1. Re: Linux virtual system won't shrink in Workstation 9.03
          WoodyZ Guru

          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:

          1. Open Terminal.
          2. Run these commands:

            cd /usr/bin

            /usr/bin$ vmware-toolbox-cmd help disk
          • 2. Re: Linux virtual system won't shrink in Workstation 9.03
            mfelker Expert

            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.

            • 3. Re: Linux virtual system won't shrink in Workstation 9.03
              ski6jones Lurker

              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.

               

              Thanks.

              • 4. Re: Linux virtual system won't shrink in Workstation 9.03
                WoodyZ Guru

                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".

                • 5. Re: Linux virtual system won't shrink in Workstation 9.03
                  ski6jones Lurker

                  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.

                  • 6. Re: Linux virtual system won't shrink in Workstation 9.03
                    WoodyZ Guru

                    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!

                    • 8. Re: Linux virtual system won't shrink in Workstation 9.03
                      ski6jones Lurker

                      Requested files attached.

                       

                      Thanks to everyone that has replied.

                      1 person found this helpful
                      • 9. Re: Linux virtual system won't shrink in Workstation 9.03
                        WoodyZ Guru

                        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!

                        • 10. Re: Linux virtual system won't shrink in Workstation 9.03
                          ski6jones Lurker

                          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.