Converting .dmg to .iso file in Ubuntu Linux

Ubuntu is a common variant of Linux, complete with a user-friendly interface and full flexibility in customizing it via the Terminal window. Windows and Linux share the ability to open ISO files, which are similar to DMG files. Though DMG files are commonly associated with Apple’s operating system, Mac, they can be opened in Linux with a few simple steps.

Step 1: Install dmg2img

  • Open up your terminal console
  • sudo apt-get update
  • sudo apt-get install dmg2img

Step 2: convert the .dmg to .img

Once dmg2img is installed, you will want to change our working directory to the .dmg you want to use. in my case, the image.dmg is on my desktop. ( /home/dan/desktop )

  • cd /home/dan/desktop

Once you are succesfully in your working directory, you are now read to convert the .dmg file.

  • dmg2img /home/dan/desktop/image.dmg /home/dan/desktop/image.img

NOTE: the second part of the command is a .img at the end.

Step 3: Mount the .img file

Now we are ready to mount the .img file into a new directory

  • mkdir /media/image
  • sudo modprobe hfsplus
  • sudo mount -t hfsplus -o loop image.img /media/image

Step 4: Convert the .img to .iso

The image is now mounted. We need to convert it to a .iso file now. Open Brasero, a program native to Ubuntu. It can be found in the “Sound & Video” section under “Applications.” When the window opens, choose “Data Disk” and then “Enable Side Panel.” (if Brasero is not installed, open up the terminal and type the following command: sudo apt-get install brasero )

Press “Image File” and “Burn.” This takes the IMG file and converts it into an ISO file. Wait for this to finish.

Step 5: Mount the .iso file

Enter the following commands into Terminal, where “image” is the name of the ISO:

  • mkdir /media/imageiso
  • sudo modprobe hfsplus
  • sudo mount -t hfsplus -o loop image.iso /media/imageiso

This will successfully mount the .iso file and you can proceed with your installation.


5 komentar:

zendog mengatakan...

Using dmg2img to convert the original .dmg file did not work, but returned the following error.

# reading property list, 1001624 bytes from address 4347043976 ...
#
# decompressing:
# opening partition 0 ... ERROR: Inflation failed

Following further investigation, I found that the .dmg was actually compressed. Using the 7z utility (part of p7zip on Fedora) I extracted the actual .dmg and then continued with the guide.

Thanks a lot.


Unknown mengatakan...

Keeps telling me "Wrong fs type." ??

Артур Ярош mengatakan...

This is not enough because mounting HFS requires the mapping the HFS partition. In case of loop it is absent :(
-- error --
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

aaronfranke mengatakan...

The ISO file that comes out of this process is bigger than the original DMG file. The ISO file that I get is too big to fit on a DVD.

TK mengatakan...

Thank you so much for not only the help in this process but also the lesson on Linux terminal command prompts. I appreciate all your time and effort.

TK@krauter82@gmail.com

Posting Komentar