From time to time I’ve downloaded Mac OS X Disk Image files only to have the system display a cryptic warning that it failed to mount because it was “Not Recognized”. It’s happened several times when I tried to download the Intel Mac version of the excellent free 3D package Blender and I wrote it off as corrupted files.
It happened again yesterday but this time today I bumped into this weblog posting by Unsanity that points at a server configuration issue as being the cause. Basically, the disk image is sent to Safari as a generic blob of data instead of being tagged as a disk image and Safari makes an (incorrect as it turns out) guess presumably based on the “bz” in the file name that the disk image was compressed using bzip2 after it was created and appends the extension .bz2 to the download when in fact the bz probably means the contents of the disk image use that compression method. OS X dutifully applied the bz2 decompression algorithm to the disk image data, strips off the extension and attempts to mount the resulting disk image which fails because it’s been thoroughly scrambled.
Now many compression methods include internal checks (looking for specific tags or verifying a checksum) to make sure you are applying them to bone fide compressed data but it appears bzip2 doesn’t, or at least the OS X archive helper doesn’t use them.
The proper fix is to let the provider of the file know about the problem, and point them at Unsanity’s post at http://www.unsanity.org/archives/macosx/mydmgisbwokenafter_download.php for details. The temporary workaround is to, when and only when you see the “not recognized” warning, remove the .bz2 extension from the original downloaded file leaving just the final .dmg then try opening file again in the Finder. If this was the cause of the problem the disk image will successfully verify and mount.
As to why only the Intel version of Blender had the problem, it turns out that the PowerPC version is served as a .zip with the correct MIME type rather than as a .dmg disk image.
Thanks to the guys at Unsanity for the heads up on this one.