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%

 


  • Prevent SSH Bruteforce and Hacks By Disabling Password Authentication
  • SMF Forums / Simple Machines Forums Not Displaying Images Theme or Styles Properly using 127.0.0.1
  • solution mysqldump: Got error: 1044: Access denied for user 'user'@'localhost' to database 'thedb' when using LOCK TABLES
  • MySQL How To Grant Access To ALL Databases For Export and Backup Purposes
  • mdadm how to stop or start a check
  • vzquota : (error) Quota on syscall for id 4532: No such file or directory vzquota on failed [3] OpenVZ Error and Solution
  • Apache htaccess Custom ErrorDocument not working properly for root home page 403 Error Issue and Solution
  • syslinux / pxelinux how to boot from local drive how to
  • samba how to listen on specific IP only
  • How To Install Windows Server 7 8 10 12 2008 2012 2014 2016 Servers Desktops using Linux tftp, dhcpd and samba
  • error: Could not locate RPC credentials. No authentication cookie could be found, and no rpcpassword is set in the configuration file Bitcoin Litecoin Error
  • OpenVZ Solutions vzquota : (error) Can't open quota file for id 123123, maybe you need to reinitialize quota: No such file or directory
  • curl: (35) Unknown SSL protocol error in connection Solution Centos
  • sudo: unable to resolve host
  • "Object of class WP_Term could not be converted to string"
  • Wordpress Instagram Post Modify Plugin To Add Tags
  • Linux input/output error invalid program cannot read data on some CD-Rs and DVD-Rs on ASUS BW-16D1HT
  • Installing SSL Certificate with Chain Intermediary CA File
  • PHP Warning: Cannot load module 'XCache' because conflicting module 'apc' is already loaded in Unknown on line 0
  • Unable to load dynamic library '/usr/lib64/php/modules/module.so' - /usr/lib64/php/modules/module.so: cannot open shared object file: No such file or directory in Unknown on line 0