I recently ran into a problem trying to open a downloaded .dmg (disk image) file: I kept getting a corrupt dmg file message when trying to open it. I downloaded it from several other locations, but the file still refused to open. I checked with a friend of mine on another Mac OS X system, and he downloaded and opened the dmg file with no problem. We compared md5sums of the file, and they were identical.
When I tried dragging the file into Disk Utility's left section, and then doing a verify on the dmg file, I'd get a Verify volume failed with error Invalid request (-9998) message. If I did a hdutil attach filename.dmg, it would give the following error:
Initializing...
Verifying...
...[trimmed]...
Verification completed...
calculated CRC32 $ABCDEF12, expected CRC32 $00000000
Finishing...
hdiutil: attach failed - corrupt image
Note the expected CRC32 checksum was zero (the calculated value was an eight-digit hex, represented here by the simple ABCDEF12 string), which is certainly unlikely. We found the problem when both my friend and I ran hdutil imageinfo filename.dmg | grep Format. On my machine, I saw:
Format Description: UDIF read-only compressed
Format: UDCO
On my friend's Mac, he saw:
Format: UDBZ
Format Description: UDIF read-only compressed (bzip2)
It turns out the DMG file was compressed with bzip2 encoding, which can only be seen/decoded by Mac OS X 10.4+ machines -- like my friend's 10.4.8 system. Mine, being 10.3.9, could only detect that the DMG file was compressed, tried decoding it using ADC decompression, and failed. The moral of the story is twofold:
Mac OS X Hints
http://hints.macworld.com/article.php?story=20061209133451185