Apple Disk Image (commonly called d m g) is the de-facto disk image format on OS X and iOS. The format is comparable to ISO and IMG. They contain a mechanism for loopback mounts. The DMG files are self-contained file-system images, and can be mounted by the hdiutil(1) command, which can also be used to create them (using its -create option). In Mac OS, a double click or using the command line of open(1) will similarly result in a mount. Contrary to popular misconception, the .DMG is not a single file format, and has several sub formats. Some also have a license embedded in them, so as to force OS X to display an acceptance GUI, prior to performing the actual mount.
The handling of the mount operation is performed at the kernel level by the com.apple.driver.DiskImages extension.
iOS is capable of mounting DMG files, and the iPhone SDK indeed contains the "DeveloperDiskImage.dmg", which contains various binaries and libraries for profiling, such as CHUD. Likewise, the recovery, restore, and file system images of iOS (contained in the .ipsw) are .DMG files. In iOS, however, the DMG file format is that of a raw file system, and cannot be readily mounted with hdiutil, unless the -imagekey argument is specified:
## ## Use file command to show image file type. Mountable DMGs are usually identified as VAX COFF, or bzip2 data ## root@Ergo (/)# file ~/iOS/5.1.restore.ramdisk.dmg /Users/morpheus/iOS/5.1.restore.ramdisk.dmg: Macintosh HFS Extended version 4 data (mounted) last mounted by: '10.0', created: Wed Feb 15 05:26:23 2012, last modified: Tue Apr 3 11:16:04 2012, last checked: Wed Feb 15 08:26:23 2012, block size: 4096, number of blocks: 4218, free blocks: 0 ## ## Normal attachment: No go ## root@Ergo (/)# hdiutil attach ~/iOS/5.1.restore.ramdisk.dmg hdiutil: attach failed - not recognized ## ## A little more forceful: ## root@Ergo (/)# hdiutil attach ~/iOS/5.1.restore.ramdisk.dmg -imagekey diskimage-class=CRawDiskImage /dev/disk3 /Volumes/ramdisk root@Ergo (/)# hdiutil info image-path image-alias shadow-path icon-path image-path: /Users/morpheus/iOS/5.1.restore.ramdisk.dmg image-alias: /Users/morpheus/iOS/5.1.restore.ramdisk.dmg shadow-path: <none> icon-path: /System/Library/PrivateFrameworks/DiskImages.framework/Resources /CDiskImage.icns ...