How to create a disk image of an entire directory on macOS
Updated 2021-04-04 · Published 2014-07-10
You can use hdiutil to manually create a disk image of an entire directory or folder by using the command below. Be sure to replace Untitled with a name for your volume, /folder/path to the directory you would like to create an image of, and filename with the file name you would like to create.
Create a disk image of a directory
hdiutil create -volname Untitled -srcfolder /folder/path -ov filename.dmg