I'm trying to add a few files into a dmg. How do I create a DMG file from a directory?
Some step by step instructions can be found here.
After opening Disk Utility:
- Click the New Image icon
- Place the contents of folder/directory into the newly created disk image.
If you want to do it from the command line,
hdiutil will provide more control than Disk Utility over how the DMG is created. As an example, you can use
hdiutil like so:
hdiutil create -volname WhatYouWantTheDiskToBeNamed -srcfolder /path/to/the/folder/you/want/to/create -ov -format UDZO name.dmg
man hdiutil for more details.
I ran across this just as late, and I figured I'd save some time for people.
I used this thread to make my dmg file, but I had to use the "-fs " parameter or hdiutil would error with error -5341.
Using Yosemite, I ran the following:
hdiutil create -fs HFS+ -srcfolder /Users/danlund/TestFolder/ -volname Test test.dmg