how to resize a disk image

Discussion in 'Mac Basics and Help' started by EssentialParado, Dec 28, 2006.

  1. EssentialParado macrumors 65816

    Joined:
    Feb 17, 2005
    #1
    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.
     
  2. mad jew Moderator emeritus

    mad jew

    Joined:
    Apr 3, 2004
    Location:
    Adelaide, Australia
    #2
    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. :)
     
  3. mkrishnan Moderator emeritus

    mkrishnan

    Joined:
    Jan 9, 2004
    Location:
    Grand Rapids, MI, USA
    #3
    If you do make a new image, can you make it sparse so you never have the issue again?
     
  4. EssentialParado thread starter macrumors 65816

    Joined:
    Feb 17, 2005
    #4
    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.
     
  5. mkrishnan Moderator emeritus

    mkrishnan

    Joined:
    Jan 9, 2004
    Location:
    Grand Rapids, MI, USA
    #5
    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.
     
  6. EssentialParado thread starter macrumors 65816

    Joined:
    Feb 17, 2005
    #6
    Oh great, I didn't know about that!

    Thanks a lot mkrishnan :)
     

Share This Page