Reclaim space from a sparse OS X disk image

| No Comments

In 10.5 and 10.5.1 there was a bug that’d make my iDisk explode to take all available space, yikes. Fortunately that has been fixed now (not that I use the iDisk much anymore - hello JungleDisk!).

It doesn’t seem like the iDisk disk images get compacted automatically to take less space if you delete files, so what I learned from the bug is generally useful.

You can compact a “sparse” disk image manually from the Terminal application.

The iDisk can’t be in use, so close any files opened on it. Then open a terminal and run:

hdiutil unmount ~/Library/FileSync/*/*.sparsebundle
hdiutil compact ~/Library/FileSync/*/*.sparsebundle

The hdiutil compact feature also works on old fashioned sparse disk images (all data in one file versus the “sparsebundles” that are really directories with lots of smaller files). I used it to reclaim a few gigabytes from some old disk images, yay.

Leave a comment

About this Entry

This page contains a single entry by Ask Bjørn Hansen published on March 25, 2008 5:42 PM.

Find recent content on the main index or look in the archives to find all content.


OpenID accepted here Learn more about OpenID
Powered by Movable Type 4.33-en
/* bf */