Using a Mac OSX DMG Image in Windows and Converting to Standard ISO Format use dmg2iso -

Using a Mac OSX DMG Image in Windows and Converting to Standard ISO Format use dmg2iso

The dmg format is silly and annoying to work with, why couldn't Apple stick with the .iso standard?  Anyway, there's an excellent Linux and Windows based tool to convert it back to a normal .iso Image called dmg2iso

I'll only cover the Linux version although the Windows pre-built binary works the same way.

Download dmg2iso here for free (from the author's website)

It's just silly and doesn't make sense that Ubuntu doesn't have this in the repository at all, it's such a useful and almost essential tool.

For some reason I'm getting dmg2iso compile errors on my Ubuntu 8.04 install:

rm -f *.o dmg2iso.exe
gcc -O3 -c dmg2iso.cc
In file included from dmg2iso.cc:23:
dmg2iso.h:45: error: â__int32â does not name a type
dmg2iso.cc: In function âint main(int, char**)â:
dmg2iso.cc:117: error: â__int32â does not name a type
dmg2iso.cc:122: error: â__int32â does not name a type
dmg2iso.cc:123: error: â__int32â does not name a type
dmg2iso.cc:124: error: âblock_typeâ was not declared in this scope
dmg2iso.cc:126: error: âout_offsâ was not declared in this scope
dmg2iso.cc:127: error: âout_sizeâ was not declared in this scope
dmg2iso.cc:128: error: âin_offsâ was not declared in this scope
dmg2iso.cc:129: error: âin_sizeâ was not declared in this scope
dmg2iso.cc:130: error: âconvert_endianâ was not declared in this scope
dmg2iso.cc:140: error: âlast_offsâ was not declared in this scope
dmg2iso.cc:158: error: âlast_in_offsâ was not declared in this scope
dmg2iso.cc:161: error: âlast_offsâ was not declared in this scope
dmg2iso.cc:172: error: âlast_offsâ was not declared in this scope
dmg2iso.cc:172: error: âlast_in_offsâ was not declared in this scope
dmg2iso.cc:84: warning: ignoring return value of âsize_t fread(void*, size_t, size_t, FILE*)â, declared with attribute warn_unused_result
make: *** [dmg2iso.o] Error 1

Instead I just downloaded the perl version.  Make sure you edit the .pl file to point to the correct path to the perl binary.  Also if you get carat M at the end of each line, remove the carat M on the first line or it will always complain perl does not exist.

 Unfortunately this tool didn't actually successfully convert the dmg image:

 

reading property list...found 6 partitions
decompressing:
partition 0
partition 1
partition 2

Conversion failed.File may be corrupted.

 

I also tried the trick of:

mount -o loop -t hfsplus file.dmg /mountpoint

but it didn't work

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

And yes I did modprobe hfsplus and modprobe hfs with no luck unfortunately.
 

 ====================================================================

Use dmg2img instead of dmg2iso, dmg2img is the one that supercedes the dmg2iso

I just found this out, but I'm getting an error during make:

 

cc -O2 -Wall -c dmg2img.c
In file included from dmg2img.c:30:
dmg2img.h:19:19: error: bzlib.h: No such file or directory
In file included from dmg2img.c:30:
dmg2img.h:34: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘bz’
dmg2img.h: In function ‘read_kolyblk’:
dmg2img.h:140: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
In file included from dmg2img.c:32:
mntcmd.h: In function ‘read_gpt_header’:
mntcmd.h:11: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
mntcmd.h: In function ‘read_gpt_entry’:
mntcmd.h:17: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
dmg2img.c: In function ‘main’:
dmg2img.c:327: error: ‘bz’ undeclared (first use in this function)
dmg2img.c:327: error: (Each undeclared identifier is reported only once
dmg2img.c:327: error: for each function it appears in.)
dmg2img.c:456: warning: implicit declaration of function ‘BZ2_bzDecompressInit’
dmg2img.c:456: error: ‘BZ_OK’ undeclared (first use in this function)
dmg2img.c:471: warning: implicit declaration of function ‘BZ2_bzCompressEnd’
dmg2img.c:482: warning: implicit declaration of function ‘BZ2_bzDecompress’
dmg2img.c:484: error: ‘BZ_PARAM_ERROR’ undeclared (first use in this function)
dmg2img.c:485: error: ‘BZ_DATA_ERROR’ undeclared (first use in this function)
dmg2img.c:486: error: ‘BZ_DATA_ERROR_MAGIC’ undeclared (first use in this function)
dmg2img.c:487: error: ‘BZ_MEM_ERROR’ undeclared (first use in this function)
dmg2img.c:488: warning: implicit declaration of function ‘BZ2_bzDecompressEnd’
dmg2img.c:499: error: ‘BZ_STREAM_END’ undeclared (first use in this function)
dmg2img.c:220: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
dmg2img.c:285: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result
dmg2img.c:516: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
dmg2img.c:532: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
dmg2img.c:546: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result
make: *** [dmg2img.o] Error 1

Make sure you install libbz2-dev and libssl-dev

Now it compiles and seems to be working unlike dmg2iso:

 

reading property list, 1839654 bytes from address 7198731606 ...

decompressing:
opening partition 0 ...             100.00%  ok
opening partition 1 ...             100.00%  ok
opening partition 2 ...             100.00%  ok
opening partition 3 ...              52.86%

 


  • How to disable Google Fonts in Wordpress
  • Unable to load dynamic library /usr/lib64/php/modules/php_openssl
  • mysqld in Linux hacked
  • W: GPG error: http://archive.debian.org squeeze Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY AED4B06F473041FA NO_PUBKEY 64481591B98321F9
  • cannot mount kvm ntfs image
  • h264 DVR security camera footage cannot be played
  • dhcpd.conf how to secure so only known and allowed clients will be given dhcpd IP address leases
  • Thunderbird E-mail List Blank White but e-mails still clickable and viewable
  • css responsive images
  • responsive table without changing much code solution
  • yum how to install old obsolete packages
  • PHP Howto Store Value of Included File Output Into Variable
  • PHP Migration from 5.3 to 5.4+ and dealing with deprecated functions
  • ffmpeg vidstab to stabilize video
  • userdel user userdel: cannot lock /etc/passwd; try again later.
  • mdadm how to mount inactive array
  • How to find and mount mdadm arrays automatically
  • M2Crypto.SSL.Checker.WrongHost: Peer certificate subjectAltName does not match host, expected fedora-archive.ip-connect.vn.ua, got DNS:mirror.ip-connect.vn.ua
  • [Wed Sep 20 15:34:44 2017] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Wed Sep 20 15:34:44 2017] [error] Init: Unable to read server certificate from file /www/ssl-certs/server.crt [Wed Sep 20 15:34:44 2017] [error] SSL Library Err
  • linux how to answer yes to copy