ArticleslgStudy

computer science

Disk compression

Disk compression is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Disk compression rather than just read about it. In short: Disk compression increases the amount of information that can be stored on a disk by automatically compressing and decompressing data as it is written to and read from it. A disk compression utility is software that provides disk compression by overriding the system's file access layer so that all programs participate in compression.

Key takeaways

  • Disk compression belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Disk compression to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Disk compression from memory before moving on to harder problems.

Reference excerpt

Disk compression increases the amount of information that can be stored on a disk by automatically compressing and decompressing data as it is written to and read from it. A disk compression utility is software that provides disk compression by overriding the system's file access layer so that all programs participate in compression. When a program writes a file, the utility compresses the data before storage. When a program reads a file, the utility decompresses the stored data before providing it to the program. Disk compression uses a single, normal file for storing the logical, user-visible files of a disk volume. This file tends to be relatively large and acts as a virtual drive. Typically, access to the compressed storage is via device driver. Similar utilities automatically compress and decompress each file instead of using a single, large file, but such a utility is not classified as disk compression. Unlike a file compression utility which is generally interactive (user specifies which files to compress and when to compress them), a disk compression utility is noninteractive (files are processed automatically as part of normal file use). This automatic behavior is sometimes described as on-the-fly, transparent, real-time and online. Disk compression was popular especially in the early 1990s, when microcomputer hard disks were relatively small (20 to 80 megabytes) and rather expensive (roughly 10 USD per megabyte). Such utilities tended to be a more economic means of having more disk space as opposed to buying a disk with more space. A good disk compression utility could, on average, double the available space with negligible speed loss. Disk compression fell into disuse by the late 1990s, as advances in hard drive technology and manufacturing led to lower cost per unit of space.

Use To start using disk compression on an existing drive, the utility would follow steps like:

Create an empty, compressed, virtual drive (a normal file on the host drive). Transfer files from the host drive to the compressed drive except for certain system files such as the swap file. Increase the size of the compressed drive to accommodate files and allow empty space when complete. Since a device driver is required to access a compressed drive, a compressed boot drive (C:) required changes to the boot process as follows:

The System BIOS loads sector 0 of the first physical hard drive (Master Boot Record). The partition sector loads sector 0 of the bootable partition (Volume Boot Record). In this case, it's the host drive. Host drive sector 0 loads (in the case of DOS) the DOS BIOS (IO.SYS, IBMBIO.COM etc.) Depending on the version, only the first few sectors of the file or the whole file may be loaded into memory. In the first case, the loaded stub contains another loader loading the remainder of the file from disk. In the case of DR-DOS, the BIOS is packed and will decompress itself through an embedded decompression routine. The DOS BIOS then loads the DOS kernel (MSDOS.SYS, IBMDOS.COM etc.) If the DOS supports the preload API, the DOS BIOS attempts to load a preloadable compression driver (DBLSPACE.BIN, DRVSPACE.BIN or STACKER.BIN) from the root of the host drive and attempts to communicate with it through the DOS preload API. If the driver responds as expected, the DOS BIOS will keep the driver, if not, it will get discarded. If kept and configured accordingly, drive letters may get swapped, so that the compressed drive becomes C:. The DOS BIOS starts CONFIG.SYS processing by looking for the file in the root of the boot drive. In the case of DR-DOS, DCONFIG.SYS takes precedence over CONFIG.SYS, if present. Compression drivers not loaded through the preload API may be loaded through DEVICE statements. Depending on configuration and if this hasn't happened already, drive letters may get swapped, so that the compressed drive becomes C:. Processing continues from compressed drive.

Considerations Performance If a system is generally CPU bound, disk compression tends to decrease overall performance because data compression requires significant CPU time. But for a system that is more I/O bound, frequently waiting for storage accesses to complete, then compressing a drive can increase overall performance. With compressed data, there is less data to read from or write to a drive. Data loss due to crosslinked files Not all compression utilities would confirm the absence of errors in the FAT file system before compressing a disk in place. Some errors, such as crosslinked files, could result in data loss during the transfer process. Boot drive accessibility may depend on another drive The compressed drive is only visible if the device driver is loaded and the compressed drive is mounted. A boot disk, for example, might not contain the driver. This was not normally an issue for solutions that came bundled with the operating systems unless booting foreign operating systems, as system utilities like SYS were modified to copy the compression drivers to boot disks by default, and the corresponding operation systems would also fall back to look for them on drives other than the boot disk if they couldn't be found there. Uninstall limited by host drive size Uninstallation was problematic if the expanded size of data on the compressed disk was larger than the normal disk capacity. Accidentally deleting virtual drive file Users did not always realize that the large file on the host drive contained the compressed drive. While it was usually hidden by the compression utility, users who did find the large file curious or suspicious were able to delete it which resulted in the loss of all the files stored in it.

Examples

Hardware-assisted Some of the initial disk compression solutions used a coprocessor via driver software. Examples include:

Stacker From Stac Electronics. Expanz! From InfoChip Systems. DiskDoubler dd2000 From Datran Corporation.

Software only As processor power increased over time, software-only solutions began to reach or even outperform the performance of hardware-assisted solutions. These utilities were third-party components, either bundled in an OS distribution or installed separately.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Disk compression

Start with the simplest possible case. Write down what Disk compression claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Disk compression before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Disk compression ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Disk compression

In research
Disk compression appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Disk compression in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Disk compression is common in secondary-school and first-year university syllabi. It links to neighbouring topics Compression file systems, Hard disk computer storage, Hard disk software, so understanding it makes those chapters shorter.
In everyday life
Look for Disk compression outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Disk compression” →

How to study Disk compression in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Disk compression means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Disk compression out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Disk compression in simple terms?

Disk compression increases the amount of information that can be stored on a disk by automatically compressing and decompressing data as it is written to and read from it. A disk compression utility is software that provides disk compression by overriding the system's file access layer so that all…

Why does Disk compression matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Disk compression?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Disk compression.

Tags

  • Compression file systems
  • Hard disk computer storage
  • Hard disk software
  • Utility software types

Keep exploring