Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

EssentialParado

macrumors 65816
Original poster
Feb 17, 2005
1,162
48
I have some documents inside a password protected disk image on an external drive. I want to put some more into the disk image, but the size I originally created it at is too small for me to add the new stuff. Is it possible to resize the disk image without corrupting the data currently inside it?

I found this, is this right:?

Code:
hdiutil resize -size 25g /PATH/TO/DISK/IMAGE.dmg

I'm on 10.3.9.
 
I've had troubles using that with protected disk images for some reason (on Tiger, not Panther). Could you create a new (larger) disk image and copy everything across? It might be safer. :)
 
If you do make a new image, can you make it sparse so you never have the issue again?

What do you mean, 'sparse' ? Is it possible to create a disk image with a dynamic size?

It's a bit difficult for me to create another disk image as I have limited space right now. But I can hopefully do it, I guess I have to if there is no way to resize.
 
What do you mean, 'sparse' ? Is it possible to create a disk image with a dynamic size?

Yes -- that's what a sparse disk image is. Disk Utility -> New Image ->

Format = sparse disk image

After you've done that, you must still set a maximum ultimate size of the image. You can make the size anything you want -- it will not be limited to the free space available (if you try to set the size first, you will not be allowed to make an image bigger than the currently available free space, but if you make it sparse first, you can create a very large max image size).

And then you can also turn on encryption if you want.

This will mount as a read/write disk as normal, but the actual image size will be the size of the files in it + a very small overhead.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.