Disk image

Also known as: ISO image

On this page 7

A disk image is a single file, or a small set of files, that stores the complete contents and structure of a storage device: a hard drive, a partition, a USB stick or an optical disc. In operating systems and OS storage, it reproduces not only the files but also the file system, partition table and boot data, so the image can be mounted, written back to hardware or started in a virtual machine as if it were the original disk.

The best-known form is the ISO image, a copy of an optical disc that operating systems use to distribute installers. Other formats such as VHDX, VMDK, QCOW2 and DMG serve virtualization, backup and software delivery. All of them share one idea: a disk becomes a portable, verifiable file.

How a disk image captures a storage device

A disk image records data block by block or file system by file system, depending on the tool. A raw or sector-by-sector image copies every sector from the first to the last, including empty space and deleted data, which makes it an exact replica but as large as the source device.

A file-system-aware image reads the allocation metadata and copies only sectors that are in use, then records enough structure to rebuild the volume. This approach produces much smaller images and faster captures, at the cost of losing unallocated space that forensic work may need.

Once created, the operating system can mount the image through a loop device or virtual disk driver. On Linux, a loop device exposes the file as a block device; Windows attaches ISO and VHDX files as virtual drives; macOS mounts DMG files through its disk image framework. The mounted image behaves like real hardware, so normal file system drivers read it without modification.

Disk image formats and their purposes

Disk image formats differ in what they capture, whether they compress, and which platform expects them. Choosing the right format is mostly a matter of matching the image to the tool that will consume it.

FormatTypical sourceMain use
ISOOptical disc file systemInstallation media and software distribution
IMG or rawAny block deviceExact copies and flashing to USB drives
VHD and VHDXVirtual hard diskHyper-V and Windows backup
VMDKVirtual hard diskVMware virtual machines
QCOW2Virtual hard diskQEMU and KVM virtual machines
DMGApple disk volumeSoftware delivery on macOS
E01Evidence driveDigital forensics with integrity hashes
Common disk image formats

An ISO file follows the ISO 9660 or UDF file system used on optical media, which is why it is read-only by design. Virtual disk formats, by contrast, are writable containers that hold an entire partitioned drive with its GPT or MBR layout.

Key properties that shape a disk image

Several properties determine how large an image is, how fast it works and how safely it can be stored. The table below summarizes the parameters administrators adjust most often.

PropertyOptionsEffect
AllocationFixed size or dynamicDynamic images grow only as data is written
CompressionNone, zlib, LZ4 or zstdSmaller files, more CPU during access
EncryptionNone or AES-256Protects data at rest
DifferencingParent with child snapshotsStores only changes since a base image
Integrity checksSHA-256 or MD5 hashDetects corruption or tampering
Disk image properties and their effects

A dynamically expanding image can reach its full nominal size over time, so planning storage around the declared capacity, not the current file size, avoids running out of host disk space unexpectedly. Differencing chains are efficient, but losing the parent image breaks every child that depends on it.

Disk image compared with backups and clones

A disk image is often confused with a file backup or a disk clone, yet each answers a different need. The key distinction is whether the result is a file, a set of files or another physical disk.

TechniqueResultBest suited for
Disk imageOne file holding the whole diskFull restore, distribution, virtualization
Disk cloneA second physical diskImmediate replacement of a drive
File backupCopies of selected filesRestoring individual documents
SnapshotPoint-in-time state on the same volumeQuick rollback, not off-site safety
Disk image versus related techniques

Because an image includes the boot loader and partition structure, it can restore a system that no longer starts, which a file backup cannot. A clone does the same job faster but ties the copy to one physical drive instead of a portable file.

Working with disk images safely

Most problems with disk images come from writing them to the wrong place or trusting unverified files. Experienced administrators follow a few habits that prevent data loss and compromised installations.

  • Verify the published checksum of an ISO image before installing an operating system from it.
  • Double-check the target device before flashing an image, because writing a raw image overwrites the entire disk.
  • Note that a hybrid ISO image boots from USB only when written in raw mode, not when its files are copied.
  • Store forensic images read-only and record their hash at capture time.
  • Keep parent and child images together when moving differencing virtual disks.

Restoring an image onto a smaller target disk usually fails unless the file system is shrunk first, and restoring onto very different hardware may need driver changes. A raw image of an encrypted volume stays encrypted, so the recovery key must be preserved with it.

A plain-language summary

A disk image is like a perfect photocopy of an entire drive saved as one file. Everything is inside: the files, the folders and the hidden parts that tell the computer how to start.

Because it is just a file, it can be downloaded, stored, emailed or opened on another computer. The computer can treat the file as if it were a real disk, or write it back onto a drive to recreate the original. The key point is that an image keeps the whole disk together, not only selected documents.

An example from practice

An IT technician at a school must prepare 40 identical classroom computers. Instead of installing the operating system and teaching software 40 times, the technician configures one machine completely and captures it as a compressed disk image of about 25 GB, stored on a network share with its SHA-256 hash.

Each remaining computer then boots from the network and receives the image, which takes roughly 15 minutes per machine instead of several hours of manual installation. Months later, when a student damages the system on one computer, the technician restores the same image and the machine returns to its known clean state within half an hour, with every application and setting exactly as originally configured.