This article originally appeared in TidBITS on 1996-08-05 at 12:00 p.m.
The permanent URL for this article is: http://db.tidbits.com/article/922
Include images: Off

Getting Through the Media Blitz

by Chad Magendanz

[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:

<ftp://ftp.support.apple.com/pub/apple_sw_ updates/US/mac/utils/Disk_Copy_4.2.hqx>

<ftp://ftp.support.apple.com/pub/apple_sw_ updates/US/mac/utils/DART_1.5.3.hqx>

<ftp://mirror.aol.com/pub/info-mac/disk/mount- image-12b2.hqx>

<ftp://mirror.aol.com/pub/info-mac/disk/munge- image-120.hqx>
<ftp://ftp.share.com/pub/peterlewis/source/ mungeimage-120-source.sit.bin>

<ftp://mirror.aol.com/pub/info-mac/disk/disk- dup-plus-27.hqx>

<ftp://mirror.aol.com/pub/info-mac/disk/disk- charmer-302.hqx>

<http://www.halcyon.com/shrinkwrap/>
<ftp://mirror.aol.com/pub/info-mac/disk/shrink- wrap-201.hqx>

<http://www.primenet.com/~wprice/cdisk.html>

<ftp://ftp.info.apple.com/Apple.Support.Area/ Developer_Services/Utilities/ DropDisk.sit.hqx>

<ftp://ftp.support.apple.com/pub/apple_sw_ updates/US/mac/utils/Disk_Image_Mounter_ 1.0.1.hqx>

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!