How MS-DOS 6.22 DEFRAG Handles Compressed Drives

This article explains how the MS-DOS 6.22 DEFRAG utility optimizes fragmented files on compressed drives created with DriveSpace. It details the two-tier structure of compressed volumes, how DEFRAG operates internally within a Compressed Volume File (CVF), and the role of host drive optimization in maintaining peak storage performance.

Understanding Compressed Volumes in MS-DOS 6.22

In MS-DOS 6.22, drive compression is handled by DriveSpace, which stores all data within a single, large hidden file called a Compressed Volume File (CVF), typically named DRVSPACE.000. This container file resides on the uncompressed physical host drive (often assigned an alternate drive letter like H:). When MS-DOS boots, the DriveSpace driver mounts this container file as a logical drive (typically C:), presenting it to the operating system as a standard FAT volume.

Because of this architecture, file fragmentation on a compressed system exists at two distinct levels:

  1. Internal fragmentation: Files fragmented across logical clusters inside the CVF.
  2. External fragmentation: The DRVSPACE.000 container file itself fragmented across physical clusters on the host drive.

Defragmenting the Logical Compressed Drive

When you run DEFRAG on a mounted DriveSpace volume (such as C:), the utility detects that the target is a compressed volume. Rather than interacting directly with raw physical disk sectors, DEFRAG coordinates with the DRVSPACE.SYS driver to reorganize data safely.

  • Cluster Reallocation: DEFRAG rearranges the internal data blocks so that files occupy logically contiguous sectors within the CVF. This reduces file lookup overhead and sequential read delays within the virtual file allocation table (FAT).
  • Consolidation of Free Space: Unlike standard uncompressed drives where free clusters can remain scattered, DEFRAG on a compressed drive actively shifts used data blocks toward the beginning of the CVF. This moves all unallocated space to the end of the container file. Consolidating free space is a prerequisite for resizing operations, as DriveSpace cannot shrink a volume if data blocks are scattered near the end of the CVF.

Defragmenting the Physical Host Drive

Defragmenting only the virtual compressed drive does not eliminate all performance bottlenecks. If the underlying DRVSPACE.000 file is fragmented across the physical platters of the host drive, overall read and write performance will suffer.

To achieve complete optimization:

  1. Run DEFRAG on the compressed volume (e.g., DEFRAG C:) to organize internal files and consolidate free space.
  2. Run DEFRAG on the host drive (e.g., DEFRAG H:) to arrange the DRVSPACE.000 file into continuous, uninterrupted physical sectors on the disk surface.

By addressing both the internal structure within the CVF and the external placement on the physical drive, MS-DOS 6.22 ensures maximum access speeds and structural integrity on compressed storage media.