macfidelity

|

Apple | Mac OS X | AppleScript | Hints | Applications and more

How to mount a DMG from Terminal in Mac OS X

August 30th, 2008 at 15:28

If you are a Terminal lover you might try mounting .dmg files from commandline.

Basicly thats pretty easy, so just continue reading

Attaching a DMG

  1. Open Terminal.app ( /Applications/Utilities/Terminal.app )
  2. Navigate to folder containing your dmg file
  3. Enter: hdiutil attach myDMGname.dmg

Thats it.

Step 2 is optional so you might skip that and change step 3 to:

hdiutil attach /path/to/myDMGname.dmg

Detaching a DMG

To be able to detach a mounted dmg, we need to know the name of it as you cant be sure its the same as you used to attach the dmg itself.

  1. Open Terminal.app ( /Applications/Utilities/Terminal.app )
  2. Check the name of the mounted dmg. Its usualy mounted in /Volumes/some-random-name
  3. To detach enter: hdiutil detach /Volumes/some-random-name

Where some-random-name is the String you found while checking the names listed in /Volumes

I hope that was helpful

Best regards
fidel

Tags: , , , , , , , , ,

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>