Mounting Disk Images (dmg) in OSx commandline

This is a short little post describing how to mount an OSx disk image in the command line. I found this useful to bypass some read-only options built into a dmg->finder relationship. All of this information can be found in the man pages hdid (8) and hdiutil (1).

$ sudo hdid -readwrite /path/to/file.dmg

Simple, its just finding the command that was difficult. The command hdid allows you to mount and change permissions of the mount while hdiutil allows you to manipulate disk images including creating, converting to other Disk Image formats (all OSx) and to Burn the disk image. Which is far more convenient than wading through Disk Utility.

This also seems to be the easiest way to make a bootable cd in OSx. Changing the filesystem options are also available when you are making a hybrid cd for booting (i.e. hfs, iso, joliet or udf [DVDs] format).

Enjoy!


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

Leave a Reply

OpenID

Anonymous