Last Updated: February 25, 2016
·
2.338K
· lvenegas

Mounting a .dmg file to your home directory

By default when mounting a .dmg file on Mac OS X it will be mounted under /Volumes.

If this is a .dmg file you use on a regular basis it can get annoying always having to cd into /Volumes.

Life would be easier if you could just mount it under your home directory where everything else lives.

We can do this on the command line using hdiutil like this:

hdiutil attach /Volumes/sd/rigby.dmg \
-mountroot /Users/lvenegas

If its an encrypted dmg it even prompts for your password!!