Resize Sparse Disk Images

I am a big fan of encrypted sparse disk images in Mac OS X. I use them primarily to keep my financial data secure w/o the need to use FileVault. This way, only the data that needs to be encrypted is protected with quick access to everything else. Using sparse disk images saves space, b/c only as much space is reserved as is needed. The only problem I have encountered, if more space is needed than was anticipated when setting up the disk image in the first place. Fortunately there is an easy way to resize sparse disk images in Mac OS X Tiger. This Wikipedia Article explains how:

  • When the sparseimage file is not mounted, the .sparseimage file may be resized from the Terminal.
  • The following example resizes a .sparseimage so that it can expand to a maximum size of 50 gigabytes: hdiutil resize -size 50g MyFile.sparseimage

  • Similarly, a .sparseimage file that has expanded in size but then had files deleted, can be “compacted” to a smaller size with the following command: hdiutil compact MyFile.sparseimage
  • Additional information about the hdiutil command may be seen by typing the following in the Terminal: man hdiutil

3 Responses to Resize Sparse Disk Images

Leave a Reply

Your email address will not be published. Required fields are marked *