Published / Modified: 2025-06-01 / 2025-06-12
Whether you just want to publish data nicely packaged or wish to archive diskettes, optical discs or even hard drives, you will come across the need to create disk images.
Below you find a collection of useful information for creating, handling and trouble shooting disk images on a Mac (Mac OS 10.4 or newer).
There are two approaches of creating disk images: you can either focus on the media's file system and create a copy of it's content or preserve the entire structure of the media - not only including partitions and file systems, but also boot sectors, partition tables and even additional track or frame data. As a consequence there are various disk image formats - with raw images one aims to capture everything possible while on the other end of the spectrum ,for example, some DMGs just contain a directory. The fameous ISO image on the other hand is similar to a raw image but focusses only on a disc's track data and does not contain media-specific information.
There are two ways to create an image from a folder:
Disk Utility - The on-screen prompts will guide you. It will by default create a .dmg, which is a macOS-specific file format.
hdiutil - This command-line utility is included in macOS. The easiest way to create a .dmg is hdiutil create test.dmg -srcfolder /path/to/folder/
, if you want to create an ISO with this tool, use hdiutil makehybrid -udf -joliet -iso -o Image.iso /path/to/folder
.
There are three ways to create a disk image:
Disk Utility - The on-screen prompts will guide you. It will by default create a .dmg, which is a macOS-specific file format.
hdiutil - With this command-line tool you can create an image from its mount point as this is treated like a normal folder (see above).
dd - Is a straightforward command-line tool you use like this: dd if=/dev/disk1 of=Image.img
. If you want to set a block size and extract an exact number of blocks starting at a specific block use options like this: bs=4096 seek=512 count=1024
. A CD's or DVD's raw sector data is exposed to this tool - therefore the result will be a raw image. In order to create a readable .iso image you will need to extract the actual user data from each 2352 byte large sector. You can use a tool like SEVEN to convert your raw image to an .iso image.
There are three ways to create a disc image:
Disk Utility - Disk Utility will also create an ISO (.cdr extension) if you select the "CD/DVD Master" option before creating the image. You can rename the extension (to .iso) after creation if desired.
Roxio Toast - The de facto third-party standard in creating optical media on Mac OS for decades, it will create almost any CD or DVD format you desire.
hdiutil - Since you can use this command to create an image file from a folder you can use it here as well: hdiutil makehybrid -udf -joliet -iso -o Image.iso /path/to/folder
.
There can be different reasons why:
Raw Sector Data - This image may have been created with a tool like dd. In that case the file is a raw CD or DVD image but not a true .iso image. Trying to mount it fails quietly and file /path/to/image
returns /file/to/image: data
. Without reducing it to the actual user data within each 2352 byte large sector an image will not be readable as an .iso image. You can convert such an image with SEVEN.
Retired Apple File Systems - Optical hybrid-discs contain multiple volumes and/or file systems. macOS seems to prefer Apple partitions: as a result, if there is a legacy HFS volume, macOS will fail to mount the .iso image and not use an existing ISO-9660 file system, for example. You might succeed in mounting the image by forcing mount to ignore specific file systems - here HFS: mount -t nohfs Image.iso /path/to/mount/point
.
To make use of specific partitions or file systems on an imaged disc, try to attach the image as device: hdiutil attach -nomount path/to/image.iso
. You will see a device listing with diskutil list
and then can proceed with mounting individual device nodes manually. Here you can force a file system, if need be: mount -vr -t msdos /dev/disk4s2 ~/Desktop/MyDisc
. The ISO-9660 filesystem does not reside within a partition - here you simply use the entire disk as device: mount -vr -t cd9660 /dev/disk4 ~/Desktop/MyDisc
Don't forget to unmount and detach the image after you are done working with it. Finder's eject button usually does the trick.
Unsupported File Systems - There may be images from discs which were designed with other platforms or architectures in mind. Linux files systems like ext1-4 or btrfs are some candidates. To access content on such partitions you will require third party software. You can, however, get some info by using the file
command - boot sectors and file systems known to the tool and, in some cases, names of partitions will be mentioned in the output. Another route is to attach the image as a device (see above) and inspect the subsequent partition devices, for example, with diskutil info /dev/disk4s2
.
On Time/ Travel Sketches