shareVM- Share insights about using VM's

Simplify the use of virtualization in everyday life

What do defrag, compress and shrink mean?

leave a comment »


De-fragmentation,  or defrag, (also see file system fragmentation) reorganizes a file into contiguous areas of used space and free space.

The file system gets fragmented when files are deleted or truncated. When the file system reuses the free fragments for new files that are created, or for new content added to existing files, blocks are dispersed across discrete fragments and may not be allocated contiguously. Fragmentation can cause performance degradation when a read/write request for the next block requires a seek to a different cylinder on the disk, essentially the dispersion of data on the disk causes random seeks for reading/writing the next block.

Defragmenation is applied to a disk and causes all the used blocks of a file to move towards the beginning of each file and all the free blocks to move towards the end. The free space can then be reclaimed by truncating the file.

File/Data Compression

Data Compression causes the reduction in storage requirements for data using a particular encoding scheme so that the encoded data uses less space than the unencoded data. The Windows zip file format and the UNIX gzip utility are examples of compressed file formats.

While compressing a file, i.e., compressing data within it, can cause a reduction in storage requirements through a change of representation, there is a conversion overhead to be paid for reading and writing to such a file. Note that data compression cannot recover free space from a fragmented file.

Reclaiming unused space through Compacting or Shrinking a File

Unused (free) space is reclaimed from a file by performing two discrete operations:

  1. Defragmenting it
  2. Truncating it so that only the used blocks (content) remains and contiguous free space is returned to the file system.

The two operations may be packaged together in a single tool, e.g., the VM Shrink from VMWare, and their effect is to resize, i.e., compact or shrink the file to a smaller size. While the term compression may be a misnomer, it also also seems to be used in the context of shrinking files

Written by paule1s

December 16, 2008 at 2:03 pm

Leave a Reply

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

You are commenting using your 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: