ArticleslgStudy

science

Apple Disk Image

Apple Disk Image is a 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 Apple Disk Image rather than just read about it. In short: Apple Disk Image is a disk image format commonly used by the macOS operating system. When opened, an Apple Disk Image is mounted as a volume within the Finder.

Apple Disk Image — main illustration
Apple Disk Image — illustration

Key takeaways

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

Reference excerpt

Apple Disk Image is a disk image format commonly used by the macOS operating system. When opened, an Apple Disk Image is mounted as a volume within the Finder. An Apple Disk Image can be structured according to one of several proprietary disk image formats, including the Universal Disk Image Format (UDIF) from Mac OS X and the New Disk Image Format (NDIF) from Mac OS 9. An Apple disk image file's name usually has ".dmg" as its extension. A disk image is a compressed copy of the contents of a disk or folder. To see the contents of a disk image, one must first open the disk image so it appears on the desktop or in a Finder window.

Features Apple Disk Image files are published with a MIME type of application/x-apple-diskimage. Different file systems can be contained inside these disk images, and there is also support for creating hybrid optical media images that contain multiple file systems. Some of the file systems supported include Hierarchical File System (HFS), HFS Plus (HFS+), File Allocation Table (FAT), ISO 9660, and Universal Disk Format (UDF). Apple Disk Images can be created using utilities bundled with macOS, specifically Disk Copy in Mac OS X v10.2 and earlier and Disk Utility in Mac OS X v10.3 and later. These utilities can also use Apple disk image files as images for burning CDs and DVDs. Disk image files may also be managed via the command line interface using the hdiutil utility. In the 10.2.3 release of Jaguar, Apple introduced Compressed Disk Images and Internet-Enabled Disk Images for use with the Apple utility Disk Copy, which was later integrated into Disk Utility in 10.3. The Disk Copy application had the ability to display a multilingual software license agreement before mounting a disk image. The image will not be mounted unless the user indicates agreement with the license. An Apple Disk Image allows secure password protection as well as file compression, and hence serves both security and file distribution functions; such a disk image is most commonly used to distribute software over the Internet.

History Apple originally created its disk image formats because the resource fork used by Mac applications could not easily be transferred over mixed networks such as those that make up the Internet. Even as the use of resource forks declined with Mac OS X, disk images remained the standard software distribution format. Disk images allow the distributor to control the Finder's presentation of the window, which is commonly used to instruct the user to copy the application to the correct folder. A previous version of the format, intended only for floppy disk images, is usually referred to as "Disk Copy 4.2" format, after the version of the Disk Copy utility that was used to handle these images. A similar format that supported compression of floppy disk images is called DART. New Disk Image Format (NDIF) was the previous default disk image format in Mac OS 9, and disk images with this format generally have a .img (not to be confused with raw .img disk image files) or .smi file extension. Files with the .smi extension are actually applications that mount an embedded disk image, thus a "Self Mounting Image", intended only for Mac OS 9 and earlier. Universal Disk Image Format (UDIF) is the native disk image format for Mac OS X. Disk images in this format typically have a .dmg extension.

File format Apple has not released any documentation on the format, but attempts to reverse engineer parts of the format have been successful. The encrypted layer was reverse engineered in an implementation called VileFault (a spoonerism of FileVault). Apple disk image files are essentially raw disk images (i.e. contain block data) with some added metadata, optionally with one or two layers applied that provide compression and encryption. In hdiutil, these layers are called CUDIFEncoding and CEncryptedEncoding. UDIF supports ADC (an old proprietary compression format by Apple), zlib, bzip2 (as of Mac OS X v10.4), LZFSE (as of Mac OS X v10.11), and lzma (as of macOS v10.15) compression internally.

Metadata The UDIF metadata is found at the end of the disk image following the data. This trailer can be described using the following C structure. All values are big-endian (PowerPC byte ordering)

The XML plist contains a blkx (blocks) key, with information about how the preceding data fork is allocated. The main data is stored in a base64 block, using tables identified by the magic 'mish'. This 'mish' structure contains a table about blocks of data and the position and lengths of each "chunk" (usually only one chunk, but compression will create more). The data and resource fork information is probably inherited from NDIF.

Encryption The encryption layer comes in two versions. Version 1 has a trailer at the end of the file, while version 2 (default since OS X 10.5) puts it at the beginning. Whether the encryption is a layer outside of or inside of the blkx metadata (UDIF) is unclear from reverse engineered documentation, but judging from the vfcrack demonstration it's probably outside.

Utilities There are few options available to extract files or mount the proprietary Apple Disk Image format. Some cross-platform conversion utilities are:

dmg2img was originally written in Perl; however, the Perl version is no longer maintained, and the project was rewritten in C. It extracts the raw disk image from a DMG, without handling the file system inside. UDIF ADC-compressed images (UDCO) have been supported since version 1.5. DMGEXtractor is written in Java with a graphical user interface (GUI), and it supports more advanced features of dmg including AES-128 encrypted images but not UDCO images. The Sleuth Kit. Only handles uncompressed DMG format, HFS+, and APFS. Most dmg files are unencrypted. Because the dmg metadata is found in the end, a program not understanding dmg files can nevertheless read it as if it was a normal disk image, as long as there is support for the file system inside. Tools with this sort of capacity include:

Cross-platform: 7-zip (HFS/HFS+), PeaZip (HFS/HFS+). Windows: UltraISO, IsoBuster, MacDrive (HFS/HFS+). Unix-like: cdrecord and mount (e.g. mount -o loop,ro -t hfsplus imagefile.dmg /mnt/mountpoint). Tools with specific dmg support include:

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Apple Disk Image

Start with the simplest possible case. Write down what Apple Disk Image claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In 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 Apple Disk Image 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 Apple Disk Image 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 Apple Disk Image

In research
Apple Disk Image appears in 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 Apple Disk Image 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
Apple Disk Image is common in secondary-school and first-year university syllabi. It links to neighbouring topics Apple Inc. file systems, Archive formats, Compression file systems, so understanding it makes those chapters shorter.
In everyday life
Look for Apple Disk Image 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 “Apple Disk Image” →

How to study Apple Disk Image in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Apple Disk Image 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 Apple Disk Image out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Apple Disk Image in simple terms?

Apple Disk Image is a disk image format commonly used by the macOS operating system. When opened, an Apple Disk Image is mounted as a volume within the Finder.

Why does Apple Disk Image matter?

Because it connects several 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 Apple Disk Image?

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 Apple Disk Image.

Tags

  • Apple Inc. file systems
  • Archive formats
  • Compression file systems
  • Disk images
  • MacOS

Keep exploring