Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Answer to disk image types...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Answer to disk image types...
Authored by: juicymixx on Jul 24, '03 05:43:46PM

I would recommend that everyone who is interested in this hint check out the man page of hdiutil (or if you don't like reading man pages, try http://osxfaq.com/man/1/hdiutil.ws , although you should probably get in the habit of checking out man pages and using man -k <keyword>)...

Use the 'hdiutil imageinfo <image_name>' command to check out the info on an image...
A good article on hdiutil can be found at: http://www.stepwise.com/Articles/Technical/2001-03-29.01.html


NDIF - New Disk Image Format
UDIF - Universal Disk Image Format

"...[The NDIF] file format comes in three flavors, Read/Write, Read-Only, and Read-Only Compressed, enabling the user to optimize the image file for flexibility, speed, or size. All NDIF flavors use industry standard CRC-32 checksums, and none waste space saving tag data.
Unfortunately, all the advantages of the NDIF format are offset by the fact that it presently only uses one compression scheme, an Apple proprietary codec named KenCode. Because of this restriction, no other commercial, shareware, or freeware utilities can legally read or write NDIF compressed image file formats without licensing the KenCode libraries from Apple. There have been overtures from Apple promising these libraries will be released to the general public at no charge, but I've seen no progress in this effort since November of 1995."
--from TidBITS #339


"UDRW UDIF read/write image
UFBI UDIF entire image with MD5 checksum
UDRO UDIF read/only image
UDCO UDIF ADC-compressed image
UDRo UDIF read/only (obsolete format)
UDCo UDIF compressed (obsolete format)
UDTO DVD/CD-R export image
UDxx UDIF stub image
UDZO UDIF zlib-compressed image
RdWr NDIF read/write image (deprecated)
Rdxx NDIF read/only image (deprecated, but still usable on OS 9 and OS X)
ROCo NDIF compressed image (deprecated)
Rken NDIF compressed (obsolete format)
DC42 Disk Copy 4.2 image"
--from hdiutil man page


"Unfortunately, Apple is very secretive and doesn't publish the format specifications. Apparently, they fear a degradation in user experience, were third parties allowed to write alternative utilities for handling disk images. Some older formats use proprietary compression algorithms, although the latest compressed format (UDZO) uses zlib. Mac OS X has a library (DiskImages.framework) that handles the various formats using a nice plug-in architecture, but it is marked private and neither headers nor documentation are available.
The "Disk Copy 4.2" format is the oldest one. It is quite straightforward (no sparse blocks, no compression) and Apple provides sample code to read it. However, the format is long obsolete and (to my knowledge) was only used for floppies.
The NDIF ("New Disk Image Format") format was introduced with Disk Copy 6.0. NDIF is a dual-fork format, meaning that all meta-data is stored in the resource fork. This makes them fragile for cross-system transport. Various variants of the format allow for sparse images (only actually used sectors are present), compression, and self-mounting images. Some more information on the introduction of NDIF is available in TidBITS #339.
Later, Apple introduced the UDIF format, which is basically the same as an NDIF, but in a robust single-fork format. Actually, it is simply the concatenation of the data fork, the resource fork, and a 512 byte header, without any padding."
--from a Google cached http://disktype.sourceforge.net/doc/ch03s13.html


"New Disk Image Format (NDIF) is used for storing dual forked files which are common with Mac OS 9 and given an extension of ".img". Universal Disk Image Format (UDIF) is used for storing single fork or flat files which are common for Mac OS X and given an extension of ".dmg". If your files contain resource forks, you'll need to use the NDIF(.img) format to preserve them. NDIF images cannot be gzipped since they contain resource forks. Gzipping will strip the resource fork and corrupt the image."
--from the docs for DMG Maker from Pliris Soft



[ Reply to This | # ]
Answer to disk image types...
Authored by: GaelicWizard on Oct 30, '03 04:57:20PM

that last part is wrong, you do NOT *NEED* NDIF to preserve resource forks, UDIF will preserve them.

---
Pell



[ Reply to This | # ]