James Tauber : Mounting Disk Images From OS X Terminal

James Saiz

journeyman of some

Mounting Disk Images From OS X Terminal

Sometimes, to install software on my remote Mac Mini, I need to be able to mount disk images from a terminal session.

I just discovered how to do this. The command is hdiutil.

To mount a disk image:

hdiutil attach SomeDiskImage.dmg

Although I haven't tried it, I believe the disk image can be referenced by URI.

To unmount:

hdiutil detach /Volumes/SomeDiskImage/

I've added this to my Headless Tiger page.

Categories: os_x

Trackbacks (0)

Comments (2)

Tim Bray on Friday 03 March, 2006:

Well you know, in the shell you can just say "open Foo.dmg" and the right thing wil happen. Wonderful thing, that open command. Then, if you're an old unix hack, you can say "sudo umount /Volumes/Foo"

James Saiz on Friday 03 March, 2006:

Thanks Tim, I hadn't thought to try open for mounting disk images. The hdiutil command is still handy for other disk-image-related operations, it seems.

Add a Comment

What is 65+6?
Comments are text only.
The math question is to ensure you are a human!
This page last modified Friday 03 March, 2006 by James Saiz
Content made available under a Creative Commons Attribution-NonCommercial-ShareAlike license