Learn about the technologies behind the Internet with The TCP/IP Guide!
NOTE: Using robot software to mass-download the site degrades the server and is prohibited. See here for more.
Find The PC Guide helpful? Please consider a donation to The PC Guide Tip Jar. Visa/MC/Paypal accepted.
View over 750 of my fine art photos any time for free at DesktopScenes.com!

[ The PC Guide | Systems and Components Reference Guide | Hard Disk Drives | Hard Disk Logical Structures and File Systems | Disk Compression ]

Volume Compression Operation

Disk volume compression works by setting up a virtual volume on your hard disk. In essence, a software-driven volume is created on the system and special drivers used to make this volume appear to be a physical hard disk. This isn't really that radical a concept, since many devices use software drivers to allow them to appear to the system under a drive letter.

When you decide to create a compressed volume on your disk, here is what the software that is creating it actually does, in approximate terms:

  1. The software asks you which real disk partition you want to use to hold the compressed volume. This is sometimes called the host volume or host partition. It will also ask you whether you want to compress the existing data on that volume (if any), or instead use the current empty space on the volume to create a new compressed volume from.
  2. The target disk volume is prepared for compression by scanning it for logical file structure errors such as lost clusters and also for errors reading the sectors on the disk. If the disk is highly fragmented, it may need to be defragmented as well, since the compressed volume must be in a contiguous block on the disk.
  3. A special file on the hard disk is created, called a compressed volume file or CVF. This file is what contains the compressed volume. If you are creating a compressed volume from empty space, the CVF is written directly onto the hard disk and prepared with the correct internal structures for operation. If you are creating a compressed volume from an existing disk with files on it, the software may not have enough free space to create the full CVF. It will instead create a smaller one, move some files into it from the disk being compressed, and then use the space that these files were using to increase the size of the CVF to hold more files. This continues until the full disk is compressed. This operation can take a very long time because of all the operations required. The more full the disk, the longer it will take, of course. :^)
  4. The CVF is hidden from view by the user, through the use of special file attributes. Special drivers are installed that will make the CVF appear as a new logical disk volume the next time the system is rebooted. This is sometimes called "mounting" the CVF, in analogy to the physical act of mounting a physical disk.

When you are using compression, then, what you see as a compressed volume is really just a giant file on a real hard disk. In some cases, you will be able to use both disks. For example, when I used to set up older systems with, say, 340 MB hard disks, I would often split the disk by creating a compressed drive called D: from say, 150 MB of space from C:. So then C: would have 190 MB free and a 150 MB compressed volume file. The compression drivers will create a logical D: volume from the 150 MB CVF. D: would typically be able to hold somewhere between 200 MB and 300 MB itself, depending on the compression ratio of the files.

Another option generally provided by the compression software is the ability to "substitute" the compressed volume in place of the host volume it is made from. This is normally done if you are creating a CVF that takes up an entire disk partition. Let's suppose you have a 540 MB hard disk that is partitioned into a 300 MB C: and a 240 MB D:, and you want to compress the entire D:. What the software will normally do after it creates the CVF taking up all of D: is to "map" the host D: drive to a much higher-up letter like H:, and then make the CVF appear as D: in its place. This allows the seamless compression of a hard disk while retaining its previous letter address.

Warning: I don't recommend doing this with the C: boot partition, even though Microsoft's DOS DriveSpace program sometimes recommends this by default. In my opinion it is better to create a separate compressed volume and leave the boot volume C: alone, so that the system can be booted more easily in the event of a problem with the compression.

Warning: If you delete the compressed volume file from the host drive, guess what happens to your compressed volume? Poof. Don't do it. :^)

Next: Free Space and the Estimated and Actual Compression Ratios


Home  -  Search  -  Topics  -  Up

The PC Guide (http://www.PCGuide.com)
Site Version: 2.2.0 - Version Date: April 17, 2001
Copyright 1997-2004 Charles M. Kozierok. All Rights Reserved.

Not responsible for any loss resulting from the use of this site.
Please read the Site Guide before using this material.
Custom Search