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 > zero.data

This will eventually fill up your virtual hard disk with 0 in zero.data. 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

rm zero.data

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 http://support.microsoft.com/kb/824517

Comments

  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

    ReplyDelete

Post a Comment

Popular posts from this blog

FFMPEG - Creating timelapse with FFMPEG with JPEG

MP4 File Format Part 1

RTSP - RTP over TCP