diskutil
command is only for disk management, when it comes to creating and restoring images there are two other commands to know of. hdiutil
, is used to manipulate disk images. For the purposes of this guide, we'll be using it to create new disk images (although there is a lot more the command can do).hdiutil
in this way must be as root, hence it starting with sudo
.hdiutil
command can also be used to create a disk image based upon a folder. -size
can be used to specify the size of the disk image to create. -format UDRW
which represents read/write.resize
option and -size
parameter. hdiutil
or diskutil
, but by the next command we'll be looking at: asr
.asr
(Apple Software Restore), is used to copy (restore) a disk image to a disk. The command used to restore a disk image is:asr
can restore one volume to another. diskutil
, hdiutil
and asr
, the functions of Disk Utility can all be performed via the command-line, from encrypted disk images to basic volume duplication.