Well, its been a while since last post. I've been a bit busy as of late, but will make efforts to keep up the 'good work' of posting regularly. Anyway, I was working on my Alph project and needed a way to create OS X disk images from the command line that contained my source directories. The reason I needed to create a disk image (rather than a tar.gz file or something) was OS X holds data in the 'resource forks' of files. So, if you have directories that have OS X executables in them (not Unix executables, but OS X apps, etc) you need to maintain this data for it to be executable on another OS X machine.
I went round and round, but finally found that this simple command works great:
hdiutil create -fs HFS+ -volname DIR -srcfolder DIR DIR.dmg
Where DIR is the directory you want to create a disk image for. That's it! When the command returns you have a DIR.dmg file sitting in your current directory, and if you...
open DIR.dmg
...the finder will mount it, and you can view it there, or in the Terminal:
cd /Volumes/DIR
Note: You don't have to name the volume the directory name, you can name it anything you want...the same goes for the .dmg filename.
Your alph project sounds super-duper. When do you expect to reveal your ideas to Rubyland? Good luck with it and happy holidays!
- Daniel
Posted by: Daniel Rubin | Friday, December 26, 2003 at 03:16 PM
DANg! Thanks for posting that easy google-able mention of hdiutil. Whew! How annoying that's been. And now it's in the Makefile. Joy. Joy I say.
Perhaps you can make use of my freeware quicktime conversion command line utility, at
http://www.omino.com/~poly/software/qt_tools/
Thanks --> d
Posted by: david van brink | Wednesday, October 06, 2004 at 12:32 PM
Hi, You might also like this HowTo for creating encrypted sparse images: http://www.macosxhints.com/article.php?story=20030212055706937
Channing
Posted by: Channing Walton | Friday, October 15, 2004 at 02:39 AM