Volume Compression Operation

Reprinted, with permission, from The PC Guide
Volume Compression Operation
 Reference Guide - Hard Disk Drives 

Disk volume compression works by setting up a virtual volume. 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 will ask 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.
  4. The CVF is hidden from view using 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 set up an older system with, say, a 340 MB hard disk, I will often split the disk by creating a compressed drive called D: from say, 150 MB of space from C:. So then C: will 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.

Another option that the compression software usually has the ability to provide is 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.

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: Volume Compression Products