Sunday, April 10, 2011

MS Virtual PC - Compact Dynamic Virtual Hard Disk For Linux Guest OS

If you are using Microsoft Virtual PC with dynamic virtual hard disk, you will realize that the size of the dynamic hard disk grow over time and it will not shrink.

MS Virtual PC provide a function to compact hardisk

But prior to use that function, you have to prepare the disk for compaction. Their preparation is simply mean zeroing your hard disk. MS Virtual PC can only reclaim zero-ed hard disk space.

For Linux, do the following

1. Start up your Linux virtual machine

2. At the console in any directory level, type

cat /dev/zero >

This will eventually fill up your virtual hard disk with 0 in This will take some time depends on the size of your hard disk.

3. When it is done, type the following commands

sync; sleep 30;sync

This is to make sure the data is written to disk

4. Then, type


This is to remove the zero file. By doing the above operation, it filled the virtual disk with zero data.

5. Shut down the Linux Virtual Machine and run the Compact Tools at MS Virtual PC

The above helps me to shrink a 20GB virtual hard disk to 11GB virtual hard disk

For information how to compact a dynamic hard disk for Window Guest OS, see

1 comment:

  1. I am new to linux platform.I worked on windows for years.So if I feel any problem then I need to search over internet.But there are a lot of posts that help me.So it makes easy.Thanks to people like you for helping free.
    digital signature software


Tomcat - removing server info

Below are the steps to remove Tomcat Server Information 1. Make sure Tomcat is not running 2. Navigate to "Tomcat Installation"...