Extract (Apple) DMG File on Linux

While developed for distributing Apple software, the DMG format goes beyond. It serves as a versatile tool for backups, environment archiving, and sharing compressed media. Mac users, with built-in DMG creation, naturally favor it over other formats like ISO.

pexels-duophenom-2417848.jpg

 

 

Step1.

sudo apt install hfsprogs

To mount the DMG image file, let’s make a new mount point by creating a new directory:

Step2.

sudo mkdir /mnt/mntpoint

Step3.)

sudo mount -t hfsplus SF-Pro.dmg /mount/mntpoint

 

That should mount the DMG image file successfully. But in this case, we’ve been prompted with a wrong file system type error.

image-20240126-092011.png

On running the following command, you can see the utility throws a bad file system error because the DMG is compressed. Linux particularly doesn’t like mounting compressed image files.

 

Accessing Compressed DMG Files

 

To solve the problem, let’s use a utility tool known as dmg2img. This tool will convert and decompress the DMG file to an IMG file.

 

 

To use dmg2img use:

 

 

dmg2img will now compress and convert the DMG to an IMG file. You can open now the image by filebrowser, nagivate to the directory and right-click, open and you see like this:

 

Â