Creating Disk Images

Learn how to create disk images using the Disk Utility app. Disk images can be used to archive old projects or combine sets of files to send to others. You can also encrypt disk images to keep the files inside them secure.
Video Transcript / Captions
Closed captioning for this video is available on YouTube: Creating Disk Images.

Hi this is Gary with Let's take a look at creating disk images using Disk Utility.

To create a disk image we're going to use the Disk Utility app. Now you can find this by going to your Applications folder and then going into Utilities and there is Disk Utility. But of course the best way to do it is just Command space and search for disk utility and run it that way.

So to create a new disk image you can use this new image button here at the top or go to File, New, and Create a blank disk image. Then you give it a name and save it just like a regular file to a location because a disk image is in fact just a file inside that file instead of having say graphics or word processing document or something like that you have a whole bunch of other files. But you are going to see it just as a regular file and this is the file name.

This is different than the name down here which you will see when you mount the disk image just call this one Test Disk Image and you will see that name appear later. You can set a size for it and you can also set a format. I would just leave it here for most uses. You can also encrypt it and you can have a password and then this password can be used to protect the files inside there. This is great if you want to create a disk image to put a bunch of files in and then email to somebody and you know it is protected.

Then you can also select different formats. You can do the rewrite disk image here but you can also do a sparse disk image which will shrink the file size to the minimum it needs. It will still look like a 100 megabyte disk but the file itself will be a lot smaller.

So let's create this and it will put it out there. At this point we're kind of done with using Disk Utility to create it and we want to actually interact with it in the Finder.

We go back to the Finder window here and we will take a look and see under Devices that Test Disk Image is actually here and it is empty. We can actually put files in it. Let me open up a second Finder window here and just grab a bunch of files and I'll put it in there. Notice it is going to copy them in because it is like this is a second disk drive. Even though it is a disk drive on our main disk drive it is treated as a separate one so automatically it is like copying to a USB flash drive or an external drive. That's what I've got in here.

Now I can look under Documents and there is that file called Test.dmg. You can see it is 100 MB in size even though I am not using all that space. It will just be that size.

Okay, so now I've got the entire disk image here as a single file here in my Documents folder. If I look in the drive I've got all the stuff inside it. I can hit the Eject button here and it goes away. I still have the file, the single file, but I can't access the files inside it at all. It just sits there like a single file which is one of the main reasons to use a disk image.

Say you have a project that has thousands of files and you're done with that project and you are sick of seeing these show up in Spotlight and searches. You're sick of having all these extra files in your drive and you just want to kind of encapsulate the entire thing into a single file which you can put away in some sort of archive. You can create a disk image like this and put all the files in there. To get into them I just double click on it is actually then going to mount that drive, there it is, and I can get to those files again.

Since it is a read write image I can remove files, delete files, interact with it just like it was an external drive that I had plugged into my Mac.

Notice that the name of the drive here on the left sidebar and here at the top is that name that I entered in but not the final name. Not Test.dmg which doesn't appear anywhere in the name of the drive. It is almost like labeling a USB flash drive by writing on it. That is not going to appear here in the Finder. It is going to be the actual official name which I gave to it.

So let's go into Disk Utility now and see that there is another option. You can actually create a disk image from a folder. So this is a quick way of doing it. I can select a folder, like say this folder with a bunch of pics, create an image and I can save it out and in one step I've create this disk image here and when it is all finished up I can go into my Documents folder, I can look at the Pics folder and you see that not only did it create it very quickly but it made it the exact size it needed to be to hold those files.

Now let's create a new disk image that is both going to be a sparse disk image and also it is going to have encryption set. I'll call it new image here and I'll call the file something similar. You can see it is going to append .sparseimage as the extension. I'll create it in the Documents folder there. It is going to ask me for a password. I'm going to assign a really weak password there and then I'm going to turn off remember password in Keychain. This is great to have turned on because it means you'll never have to enter the password in again on your computer. So you send this to someone else and they'll need to enter it in. I'm going to turn it off just so I can demonstrate having to enter the password in.

It is going to create this new sparse image. Now I stuck with 100 MB as the size for this sparse image. So you can see there new image right there and I go in and you can see it still thinks there is a 100 MB available. I'm going to grab some files here and drag them in, right there. So I've copied them in and now there is five items in there.

I'm going to then look at the Documents folder and you can in the Documents folder I've got this NewImage and it is still pretty small because it will adjust in size. I'm going to eject the NewImage drive so it is no longer mounted. I can no longer access it in the Finder and then attempt to mount it again.

When I do that, double click on the file there, it is going to ask me for the password and I don't have access until I enter the password in. Not only is it password protected but it is important to realize it is encrypted which means that the files simply are all garbled until you enter that key in which is the password. So it makes it hard or almost impossible for somebody to get. Great if I wanted to send these files encrypted to somebody else on a Mac who could then just get this single file disk image and enter the password in and get access to these files.

Comments: 13 Responses to “Creating Disk Images”

    4 years ago

    Very helpful, indeed. Thanks for another great how-to

    4 years ago

    Nice. I always learn new things from your videos. Thanks!

    4 years ago

    So an encrypted sparse image seems to be the native OS X equivalent to Boxcryptor?

    Scott Beattie
    4 years ago

    Thanks Gary – Very useful video. In your examples you used Sparse disk images vs the newer Sparse Bundle images. People may question image format to choose – Sparse or Sparse Bundle. Can you explain the difference between the two formats. I have a general understanding – but I find conflicting explanations when Googling. Disk Utility Help actually does not explain the differences – at least not that I can find.

      4 years ago

      Bundles are seen by the file system as a group of separate files and folders, even though you see it as a single unit. Sparse images are seen by the file system as a single unit. In most cases you can use either. In some situations, like copying and backing up, bundles work better for the system.

    4 years ago

    What’s the difference between creating a Disk Image vs Zipping a file using programs like 7Zip?

      4 years ago

      Not familiar with that particular one, but zip files are usually created, transported, and then decompressed to get the files out. Disk images can be altered — adding new files, removing others, updating others. You can even work with the files while they are inside.

    Scott Beattie
    4 years ago

    Disk Utility is also useful for making a complete compressed image backup of your Mac’s internal hard drive to an external drive. This is not a bootable clone – rather a disk image to use in case you need to restore your Mac quickly. Gary can you create a video on how to do this?

      4 years ago

      Clones aren’t as useful as they used to be. All new Macs have the restore partition. And if you use that, plus your Time Machine backup, you can get back to work quickly. More importantly, you can get back to work without losing much. With a clone, you would lose everything after the last time you cloned. That would typically be a week or more. Time Machine backs up every hour.

    4 years ago

    Gary: wonderful tutorial. will this disk image be useable for people using windows? this would be a wonderful way to email recpts to accountant, but he only uses windows. is there a way to do this across platforms? thx

      4 years ago

      Only if you format the disk image to ExFAT or another format that Windows can understand.

    cake rose
    4 years ago

    How the disk image is made bootable to a cd or a pendrive?

      4 years ago

      You wouldn’t use a disk image for that. You would just make the whole drive a bootable disk. To do so, you have to create a special type of disk and how to do so depends on which Mac you have and which version of OS X you are using. Search on those things and you may find it. But newer Macs don’t need this as they have a bootable partition for problems.

Comments Closed.