Virtual HD compression/compaction?

Discussion in 'Linux Virtual Machine' started by Jon Richardson, Jul 3, 2008.

  1. Jon Richardson

    Jon Richardson Member

    Messages:
    21
    What is the recommended way to compact an expanding virtual HD in Ubuntu Guest (8.04)?

    I know the Parallels Tools (for Linux) don't include a feature to do this, so how do people reclaim unused space from an expanding hard drive in this situation?

    I'm not too concerned about de-fragmenting the virtual drive image itself (I can do this OK in OSX), I'm more concerned about reclaiming the unused space now the drive has expanded to about 3 times the actual size.

    Any suggestions from anyone?

    OSX 10.5.4 Host - Ubuntu 8.04 Guest - Parallels 5608
     
  2. John@Parallels

    John@Parallels Forum Maven

    Messages:
    6,333
    Check Parallels Desktop for Mac user guide from http://www.parallels.com/en/download/file/doc/Parallels_Desktop_for_Mac_User_Guide.pdf on page 244 section
    2 A compacting stage performed in Mac OS X. This procedure removes clean unused space
    from the virtual disk file (only space available at the end of the file). This is available for
    virtual machines with any other guest operating system and is performed from
    Configuration Editor.
     
  3. Jon Richardson

    Jon Richardson Member

    Messages:
    21
    Thanks for that, John, however, the option is currently greyed out in the menu.

    Presumably that is because the Parallels Tools are not installed and currently fail to install on this combination of Parallels 5608 + Ubuntu 8.04.

    So would I be right in assuming that once Parallels Tools can be installed, this option will then be available again?

    many thanks
     
  4. John@Parallels

    John@Parallels Forum Maven

    Messages:
    6,333
    No, Tools are not related in this case
    Check for Snapshots and undo disks
     
  5. Jon Richardson

    Jon Richardson Member

    Messages:
    21
    Ok, John, problem solved (I was looking at the wrong menu option!)

    Thanks again.

    Now, I'm just waiting for a version of Parallels Tools for this version of Ubuntu (like many others). :))
     
  6. shavital

    shavital Member

    Messages:
    69
    This are the instructions I received from Parallels/Support, December 2007. I followed them and they worked OK. "Please, check if your virtual hard drive is plain or expanding - just
    compare its size both from the VM side and from the Mac side. Additional
    info about disc types is here: http://kb.parallels.com/entry/27/451/0/

    For the compressor issue, please, try to follow these instructions:
    1. Shut down the virtual machine. Click Start and choose Shut Down.
    2. Close Parallels.
    3. Browse to the Applications - Parallels folder and start Parallels
    Image Tool.
    4. Choose the required virtual hard disk of the virtual machine and
    choose the "merge snapshots" option. This will take a while.
    5. Delete the snapshot folder and snapshots.xml file located in the
    virtual machine folder (Documents - Parallels - virtual machine folder -
    snapshots folder)
    6. Open Parallels and the virtual machine.
    7. Try to compress the virtual disk once again.
     
  7. dullerm

    dullerm Bit poster

    Messages:
    7
    Preparatory stage for non-Windows OS'

    Use the following tip on your own risk!
    What I typically do before compacting a Linux (and other) virtual drive from Mac OS X: I fill the filesystem(s) on the virtual disk to the maximum with a file containing zeros. For example:

    dd if=/dev/zero of=/tmp/zerofile bs=1M

    Once the filesystem(s) is/are full (and dd terminates from this error) I remove the file(s) again, shutdown the VM and then compact the virtual disk from Mac OS. This gives Parallels the possibility to really compact empty space on the virtual drive which is not possible otherwise, if the space was used before, then "freed" by deleting the files but not actually overwritten with zeros - which is normal behavior for most filesystems.
    If I remember correctly, I once "caught" Parallels Tools for Windows doing the same - creating a file as large as possible and causing Windows to display the "Disk Space low" bubble.
     
  8. shavital

    shavital Member

    Messages:
    69
    Thanks for the tip.
     
  9. griffdb

    griffdb Member

    Messages:
    26
    I can't get the disk compaction to work on a Linux disc. I have an expanding disk. When I click on the "Compact" button, it tells me "cannot apply compacting operation to a non-expanding virtual hard disk!". The disk I am using is a split expanding disk.

    Any thoughts or suggestions?
     
  10. John@Parallels

    John@Parallels Forum Maven

    Messages:
    6,333
    Try to open disk in Parallels Image Tools and check how it is recognized
     
  11. griffdb

    griffdb Member

    Messages:
    26
    The compressor works if the disk is not split.
     

Share This Page