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.
Â
Â
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.
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:
Â
Â