Disk Utility: Resizing a sparse disk image

Posted by Pierre Igot in: Macintosh
November 23rd, 2009 • 11:33 am

A while ago, I created a password-protected disk image with a 20 GB size using Disk Utility. Since I knew that I might have to increase the size of the disk image eventually, I elected to use the “sparse image” disk image format, which is supposed to allow you to do just that.

Then today I ran out of space on the 20 GB disk image and decided to increase its size by 5 GB.

I went to Disk Utility, selected the disk image and clicked on the “Resize Image” button in the toolbar. (You can also use the “Resize…” command in the “Images” menu.)

This gave me a dialog sheet asking me to input the desired size:

Resize

So far so good. I entered the desired size (25 GB) and clicked on the “Resize” button. And then… nothing. No progress bar. No confirmation dialog. Nothing.

When I checked the disk image’s size in the Finder, it was still 20 GB. When I mounted it, it still indicated that it was almost full. In other words, it looked like the operation had not worked at all.

I tried to explore the more advanced options in the “Resize Image” dialog sheet and saw that you can specify that you want to resize the image only, the partition only, or both. The default is both. I tried to repeat the operation with the image only, but it didn’t make any difference.

Eventually, I stumbled onto a forum post indicating that Disk Utility seems to have a bug where it fails to resize the partition contained within the image properly.

So I mounted the disk image and went to the “Partition” tab in Disk Utility. And sure enough, while the size of the disk image was now 25 GB, the size of the partition within the disk image was still only 20 GB. So I manually stretched the partition in order to make it fill the entire disk image, and then clicked on the “Apply” button.

And it finally worked. After that, the mounted disk image now showed that I had a little over 5 GB of free space left. Phew.

The disk image file still only has a 20 GB size in the Finder, but if I understand correctly, that’s normal, because that’s what a sparse image does. It only uses as much space as necessary. It will grow gradually as a file in the Finder as I add more stuff to the mounted volume.

Still, based on what this forum post says, there is a bug here, and this bug has been around for a while. One has to wonder why it is taking so long for Apple to fix it, especially considering that there is nothing obvious about what the user is required to do in order to work around it.

I suppose the bug has a low priority because Apple feels that users who bother with sparse disk images in the first place ought to be fairly experienced users who can figure out the way around such problems themselves, and I suppose my own case confirms this assumption. But I still think that, in this day and age, more Mac users need to be educated about file security issues, and more users ought to be using password-protected and encrypted disk images for important stuff that they might to want shield from eyes, especially laptop users who run a higher risk of their computer being stolen.

So there might an opportunity here for Apple to use the leverage of its own technology to nudge people in that direction. But first, Apple would have to fix obvious bugs such as the one above, and second, it would have to design a much more user-friendly user interface for working with disk images in the first place.


Comments are closed.