by Chad Magendanz <email@example.com>
[With Apple's recent flood of software releases and updates, TidBITS has been receiving a number of questions about disk images: what they are, how to use them, and where they came from. Since few people know more about disk images than Chad Magendanz (author of the widely-acclaimed disk image utility ShrinkWrap), when Chad volunteered to write an article on the subject, we took the opportunity to chain him to his keyboard, crack our whips, and get a definitive run-down on disk images and disk image software. Enjoy! -Geoff]
At the most basic level, a disk image is simply a file that contains a verbatim copy of every sector from a disk. Although disk images of floppy disks are by far the most common, the concept applies to disks of any size. As the cost of high-capacity storage has decreased, people have been using disk images for more than distributing system updates. Mac users are finding it increasingly difficult to justify hanging on to the hundreds of floppies when they can preserve images of these floppies neatly on high-capacity, removable media. After all, when one CD-R disk can easily hold over a thousand compressed floppy disk images, it suddenly becomes realistic to carry your complete software archive wherever you go.
Exposing An Image -- Disk images ensure that everyone receives the same material electronically that they would receive if they were handed a floppy disk. You can think of a disk image as a temporary scratch file that allows for time-delayed disk duplication: you simply run a disk image utility to recreate the original disk. To ensure that the disk reproduces correctly, disk images contain checksum values. Checksum values are virtually unique "signatures" generated from a disk's content; since the odds of two disks having different data and the same checksum value are astonishingly low, checksums are an efficient way of making sure disks are identical.
When copying a floppy disk, it doesn't always work well to drag the disk's contents to a different disk or to a folder. A disk duplicate made from an image file is an exact duplicate, whereas a disk copy made by dragging icons is not. Disks created from image files duplicate their originals exactly, including icon placement, window appearance, and the disk name. Disk images offer the added assurance that all files have duplicated correctly and completely. More importantly, many installers fail to recognize disks copied by dragging icons, even if these disks appear identical to their originals.
The Virtual Volume -- Originally, an obvious drawback to image files was that you had to copy an image file back to a real floppy disk to use it, an annoying and time-intensive process. Fortunately, there are now several reliable utilities that enable Mac users to mount disk images on the desktop as virtual floppy disks. These utilities allow the system to think that an actual floppy disk has been inserted, and some even allow you to mount images as unlocked volumes so you can make and save changes to the image files.
In addition to allowing you to conduct a complete installation without touching a floppy disk, mounted disk images offer several less obvious but equally important applications. Think about it: Macs without high-density SuperDrives (or PowerBooks with no floppy drive at all!) can access any type of floppy if you can make a disk image and transfer it via a network connection. You can even use mounted disk images as temporary partitions like a RAM disk, but unlike most RAM disks, volumes created from mounted images can be created or destroyed at any time without restarting your machine. Finally, the checksums generated for disk images can be used to track changes made to media released for software development, manufacturing, and distribution.
Disk Image Utilities -- The original disk image utility for the Macintosh was Apple's DiskCopy, written by Steve Christensen at least seven years ago. As the years went by and Apple's original offering saw no significant updates, many new disk image utilities (and new disk image file formats) began to appear. Here's a chronological summary of utilities currently available:
DiskCopy 4.2 by Steve Christensen from Apple. Steve used his intimate knowledge of the SONY driver to make this one of the most elegant and compatible applications ever packed into 24K. DiskCopy 4.2 is still the only disk image utility officially supported by Apple.
DART 1.5.3 by Ken McLeod from Apple. This utility went a step beyond DiskCopy 4.2, adding interface improvements, simple drag & drop functionality, and a new image file format that supported RLE and LZH compression. Unfortunately, DART suffers from slow performance compared to DiskCopy.
DiskCopy 5.0d1-6.0 by Steve Christensen (and "anonymous contributors"). Based on a beta of DiskCopy 5.0 that was leaked to the general public without Steve's consent, this application has been lurking on BBS's for years, wearing several different version numbers. Although they look and act much like DiskCopy 4.2, these builds add support for two new image file formats, an RLE compressed disk image and a self-extracting disk image that can decompress and save itself to floppy disk. Use of these versions of DiskCopy is discouraged since they're not supported by Apple and the new image file formats they produce don't work with other disk image programs.
MountImage 1.2b2 by Steve Christensen. This control panel can mount up to eight disk images on the desktop. Unfortunately, MountImage has a serious bug that can cause data corruption if the original image file is split into more than three fragments when stored on disk. In this case, MountImage can lose track of some data fragments, blindly reading and writing to blocks that may not belong to the image file, which can overwrite and damage other files on your drive. Use of MountImage is highly discouraged, even by Steve.
MungeImage 1.2 by Peter N Lewis and Quinn "The Eskimo." MungeImage, a famous eight hour hack, works around MountImage's fragmentation problem by loading disk images entirely into RAM. It has a faceless drag & drop interface and can mount both DiskCopy and DART images, although only DiskCopy images can be mounted as unlocked volumes. Peter and Quinn have placed MungeImage's Pascal source code (which includes descriptions of DiskCopy and DART file formats) in the public domain.
Norton Floppier 3.2. This disk duplication and formatting component of Norton Utilities 3.2 only supports its own proprietary disk image format, but does provide an option to copy only used sectors.
MacTools FastCopy 4.0. This component of MacTools Pro 4.0 provides the same functionality as Norton Floppier, but supports Apple's DiskCopy image files and its own compressed image files (which use Stacker's proprietary compression algorithm).
DiskDup+ 2.7 by Roger Bates. This utility excels at disk duplication, sporting options to ignore unused or bad blocks and even copy 800K images onto 1.4 MB media with increased free space. DiskDup+ supports reading and writing Apple DiskCopy images as well as its own DiskDup+ image file format, and will mount image files after you pay the $25 shareware fee. Roger also has a commercial version called DiskCopy Pro that supports removable media larger than floppies.
Disk Charmer 3.0.2 by Fabrizio Oddone. This $10 shareware utility's claim to fame is its ability to read, write, and format floppy disks in the background using asynchronous I/O and the Thread Manager. Copies take a little longer, but the ability to switch to another application and perform another task while you read or write DiskCopy disk images can be a real boon.
ShrinkWrap 2.0.1. (I know this is my own program, but I never claimed to be unbiased!) This utility reads, writes, mounts, and converts a variety of images files for volumes of all sizes, including new self-mounting image files that can mount or save themselves back to disk. Designed around a drag & drop interface, ShrinkWrap also provides an menu-driven front end and a full-featured Apple event suite. It handles integrated compression, encryption, and encoding through Aladdin's StuffIt Engine and has a batch mode that speeds large jobs. ShrinkWrap is freeware, but with a $20 shareware fee for commercial use.
CryptDisk 1.2.1 by Will Price. This $20 shareware tool is designed for disk image users who take encryption very seriously. Although CryptDisk doesn't read or write image files to disk, it does create and mount soft partitions of any size that are encrypted using IDEA (International Data Encryption Algorithm) encryption. IDEA uses 128-bit keys and is generally recognized as secure. The full version of CryptDisk is available for U.S. and Canadian citizens; a demo without encryption is available to anyone.
DropDisk 1.0b5 by Chris Cotton and Mike Wiese. Originally released as Mount 'em, Chris and Mike leveraged much of the work done to mount PC drive containers for Apple's DOS card with PC Exchange to overcome the problem with fragmented disk image files and mounting disk images from a network. However, the application has only a drag & drop interface and can't mount DiskCopy images unlocked.
Disk Image Mounter 1.0.1 by Apple. This direct descendent of DropDisk was given a simple front end, modified to support New Disk Image Format (NDIF; see below) images and DiskScripts (batch files for mounting disk image sets), then packaged with the PowerBook 5300s. It only supports mounting disk images as unlocked volumes.
DiskCopy 6.0.1 by Byron Han for Apple. DiskCopy 6.0.1 will be a complete rewrite of DiskCopy, supporting copying, creating, converting, and mounting DiskCopy 4.2 and NDIF disk images. It will also add support for AppleScript, log files, CRC-32 checksums, DiskScripts, and digital signatures. Currently, DiskCopy 6.0.1 is currently only available for Apple internal use.
Some Fuzzy Images -- I should point that some installers don't play well with disk images: the most notable are from Microsoft and Connectix. Many of Microsoft's installers simply don't check if the next disk is available before ejecting the current disk and prompting the user to insert a floppy. Of course, "reinserting" a mounted disk image from a modal dialog is practically impossible. Connectix's installer, on the other hand, is clever enough to determine if it's being run from a physical floppy disk and forces the user to quit if that's not the case, probably as an attempt to deter piracy. Of course, you can work around these installers by copying disk images to floppy disks and running the installer the old fashioned way, but that's not as convenient.
Additionally, developers usually take two approaches to mounting disk images: RAM-based and file-based. A file-based driver mounts image files by accessing blocks directly from a local hard drive or a network server; conversely, a RAM-based driver mounts an image file by dynamically creating a RAM disk and then copying the contents of the image file to the RAM disk. Although the RAM disk eventually makes for faster performance, mounting the image takes longer and you must always have as much free RAM as disk capacity you wish to mount. (Sorry - virtual memory doesn't count!) File-based drivers typically use only about 1K of RAM per mounted image, but they're slower and can be confused by background compression utilities like AutoDoubler or StuffIt SpaceSaver. Currently, all the utilities mentioned above except MungeImage use file-based drivers, although ShrinkWrap supports both techniques.
Versions of Apple's DiskCopy prior to 6.0.1 have a problem with occasionally incorrectly calculating checksums for tag data. Tag data is an extra 12 bytes of "scavenger" information for each block on 400K and 800K floppies. It was mainly used to embed copy protection information and data recovery hints back in the old days of half-tracking and other such whimsical annoyances. Since the 660AV and 840AV Macs can't even read tag data, many disk image utilities and disk image formats safely ignore it.
New Disk Image Format -- With the glut of alternative disk image file formats available, you may find it surprising that the original DiskCopy format still dominates online. Well, aside from the disadvantage of having to compete with the officially endorsed Apple image file format, many of the "improved" image file formats fall short of DiskCopy in critical areas. For example, compressed image files or images that don't contain copies of unused blocks can't be mounted on the desktop as unlocked volumes. What's more, many simplified file formats lack critical information like checksums and tag data that may be critical to identifying data loss or satisfying some copy protection schemes.
However, there are some simple ways the present DiskCopy image file format can be improved, and the New Disk Image Format (NDIF) supported in Disk Image Mounter 1.0.1 and DiskCopy 6.0.1 is Apple's attempt to do just that. This new file format comes in three flavors, Read/Write, Read-Only, and Read-Only Compressed, enabling the user to optimize the image file for flexibility, speed, or size. All NDIF flavors use industry standard CRC-32 checksums, and none waste space saving tag data.
Unfortunately, all the advantages of the NDIF format are offset by the fact that it presently only uses one compression scheme, an Apple proprietary codec named KenCode. Because of this restriction, no other commercial, shareware, or freeware utilities can legally read or write NDIF compressed image file formats without licensing the KenCode libraries from Apple. There have been overtures from Apple promising these libraries will be released to the general public at no charge, but I've seen no progress in this effort since November of 1995.
Your Mission -- Has the time come to throw away your floppies? For many Mac users, the answer is definitely yes. One batch session with a good disk image utility can reduce a rat's nest of floppy disks to a manageable archive on removable cartridge or CD-ROM that you can take on the road and share over local networks or the Internet. Software installations from mounted disk images can save countless hours, especially for MIS managers, testers, and service technicians who configure new machines daily. So, find a utility that suits your tastes and discover the power of disk images!