Sparse Image Size Question
My question is: Shouldn't the size of a sparse image on your HD dynamically shrink if you delete its contents?
I have a 22 GB Sparse Image on an external USB 2.0 HD. I just deleted about 18 GB of its contents, and deleted the .Trash files manually. However, while OmniDiskSweeper informs me that I only have about 4 GB on the image, it's taking up 22 GB on my HD.
Maybe I'm confused about how sparse images work.
Am I?
--B
I have a 22 GB Sparse Image on an external USB 2.0 HD. I just deleted about 18 GB of its contents, and deleted the .Trash files manually. However, while OmniDiskSweeper informs me that I only have about 4 GB on the image, it's taking up 22 GB on my HD.
Maybe I'm confused about how sparse images work.
Am I?
--B
Comments
"Well it turns out shrinking those bloated sparse images is not a problem. Just unmount the image if it is mounted. Then pull up a Terminal window and type:
hdiutil compact /some_path/your.sparseimage
where /some_path/your.sparseimage is the path and file name of the sparse disk image. This will harmlessly reduce the sparse image down to the minimal size needed to contain the files within it. It does not erase the disk image and you won't lose any files doing this. As a side effect, it is likely the files in the image and the imagefile itself will be defragmented in the process. The process is very fast if the image is mostly empty.
Of course it is a swell idea to make a backup copy of the sparseimage before you compact it, just in case!"
I haven't tried it, but it seems simple enough to do and should solve your problem.
Originally posted by pubguy
hdiutil compact /some_path/your.sparseimage
Didn't work for me. Spent about 5 minutes doing something, but in the end it was still at 22 GB. I ended up copying the files I wanted out of there and into a folder, deleting the sparseimage.
Thanks for the tip, though.
--B