shareVM- Share insights about using VM's

Simplify the use of virtualization in everyday life

What does the vhd pre-compactor do?

with one comment

Files are represented on disk by a sequence of blocks. The operating system maintains a list of free blocks and used blocks. When files are created by a program, the operating system takes some of the free blocks, marks them as used and attaches them to the file. Similarly when the file is deleted the blocks as part of the file are put back on the free block list.

However the deleted blocks are not zero’ed out. So consider a virtual image which at its peak had 3GB of used blocks, but since then a lot of files have been deleted and is currently using only 1GB. There are 2GB of free blocks on the system, but these blocks are not necessarily zero, they may contain the contents of some files which have been deleted.

The pre-compactor zeros out the deleted blocks. It does this by creating a large file and writing zeros to it. The operating system keeps giving it all the free blocks and the pre-compactor just zero’s them out.

Then the compact tool can collapse these zero blocks and realize some savings. Ideally one should run defrag on the disk before running the pre-compactor (see article)

Written by RS

November 25, 2008 at 6:29 am

One Response

Subscribe to comments with RSS.

  1. […] Product Demo ← What does the vhd pre-compactor do? […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: