A walk outside the sandbox

Home Blog Cheat Sheets MacOS Tips Area 51 About

DMG Images



  • Apple disk images, typically having a .dmg extension, are a format used to distribute software because it allows the creator to control the Finder’s presentation of the window and to instruct the user to copy the applications to the Applications folder.

A DMG file is a mountable disk image created in Mac OS X. It contains raw block data typically compressed and sometimes encrypted. DMG files are commonly used for OS X software installers that are downloaded from the Internet and mounts a virtual disk on the desktop when opened.

.DMG File Extension
  • Because Apple disk images allow secure password protection and file compression, this makes them very useful for software distribution.
  • A disk image can contain multiple file systems (HFS, HFS+, FAT, etc).
  • It’s easy to create disk images using just utilities bundled with macOS.

How to work with DMG files

  • There are a few options to extract the content from the proprietary image format using 3rd party utilities, but the easiest way is to use built-in tools:
~ hdiutil attach EliteMonitor.dmg
expected   CRC32 $D31C24BA
/dev/disk2          	GUID_partition_scheme
/dev/disk2s1        	Apple_HFS                      	/Volumes/EliteMonitor

~ ls /Volumes/EliteMonitor
total 32
drwxr-xr-x  3 m     staff    102 26 Aug  2017 .background
drwxr-xr-x  3 m     staff    102 26 Aug  2017 Elite Monitor

~ hdiutil detach disk2s1
"disk2" unmounted.
"disk2" ejected.