APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

Mac OS X disk images .dmg dmg create creating disk images

From: Tony Lawrence <tony@pcunix.com>
Subject: Re: Recent switcher
Date: Mon, 03 Feb 2003 10:58:40 GMT

Pim Versteeg wrote:
> Probably a very dumb question ,but...
> Can anyone please give me a pointer towards some information re mounting
> (virtual) disks. When I download stuff, all of a sudden I see some (virtual)
> disks on my desktop which disappears when I install the apps
> There must be more to this, any assistance would be much appreciated

As others have explained, those are disk image files.

What wasn't mentioned is that disk images are easy to create, both 
graphicallly and from the command line.  Disk Copy 
(Apllications/Utilities) lets you create blank images which you can then 
double click, copy stuff to etc.  Eject by dragging to Trash, then go 
back to Disk Copy and "Convert" it.

Ftom a shell window, the process is a little harder but of course you 
get more control and you can put it in a script that you call whenever 
you need it.

# create a 4MB disk image
hdiutil create -megabytes 4 myimage.dmg -layout NONE
# associate a device with this but don't mount it
MYDEV=$(hdid -nomount myimage.dmg)
# create a file system
newfs_hfs -v Myvol $MYDEV
# diassociate device
hdiutil eject $MYDEV
# mount it
hdid myimage.dmg
# copy stuff to it
/bin/cp /Somefiles /Volumes/Myvol
# eject
hdiutil eject $MYDEV
# compress it and make it read only
hdiutil convert -format UDZO myimage.dmg -o mycompimage.dmg

Tony Lawrence
Free SCO, Mac OS X and  Linux Skills Tests: 

Got something to add? Send me email.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> -> Mac OS X disk images .dmg dmg create creating diskimages

Increase ad revenue 50-250% with Ezoic

More Articles by

Find me on Google+

© Tony Lawrence

Kerio Samepage

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

The people I distrust most are those who want to improve our lives but have only one course of action in mind. (Frank Herbert)

This post tagged: