Shirt Pocket Discussions

Shirt Pocket Discussions (
-   General (
-   -   Smart Update to Sparse Image takes up far more space than source (

harvardslacker 06-09-2007 10:02 AM

Smart Update to Sparse Image takes up far more space than source
I have been backing up my 500GB source drive with about 250GB of data on it to a spare disk image on a 250GB destination drive. Because I now have enough data that it won't all fit (although this problem occurred before that), I changed the script to share the TV Shows and Movies directories in my iTunes directory, which are about 16GB and 80GB, respectively. Thus, I shouldn't be copying more than about 160GB to the disk image.

However, I consistently get out of space errors, and when I mount the disk image (which has a capacity of 465.44GB, in case I later move it to a 500GB drive from the current drive) it says that it has Zero KB available. When I just tried an Erase and Copy rather than a Smart Update, it completed without any errors, but still has Zero KB available on the disk image, so I assume that it will fail if I try Smart Update again.

Looking at the User Guide, it seems that two things might be causing these erroneous out of space errors: 1) renaming or moving large files, and/or 2) having programs running during the backup.

I certainly do rename and move large files in between backups, but these are on the order of <=1GB files, and not more than 10GB of files total. So it doesn't seem like they could account for the difference between the 232.57GB disk capacity and the approx. 160GB of data. Since this backup occurs at night, and since I don't want to enable auto-login, I leave my user account open, which frequently means that other programs are still running. These would normally include a web browser,, iCal, iTunes, a BitTorrent client, and perhaps a couple other programs. Of these, the only one that I would think might be a problem would be the BitTorrent client. However, this wasn't running when I tried the Erase and Copy, and yet there is still no space left on the disk image. Shouldn't the Erase and Copy have left the disk image with approx. 232-160=62GB available?

When I have a chance, I will try running a Smart Update with no programs running, but in the meantime I hope that someone can give me a clearer idea of what is going wrong here, so that I can get a closer to ideal backup system working.

Thanks in advance,


harvardslacker 06-09-2007 10:11 AM

Thanks to the 'related threads' feature, I found another thread in which someone mentioned hdiutil's 'compact' function, which reclaimed 75GB from the sparse image. I will try adding a shell script that runs that on the image before and/or after the Smart Update, to see if that fixes the problem.

dnanian 06-09-2007 12:54 PM

Note that you need to do this to the image file, typically when closed, so delay a background script for 20 seconds or so...

harvardslacker 06-09-2007 01:08 PM

Running hdiutil compact during copy script

Originally Posted by dnanian (Post 12460)
Note that you need to do this to the image file, typically when closed, so delay a background script for 20 seconds or so...

I noticed that the 'compact' command failed whenever the disk image was mounted, so I made a shell script that unmounts the image, compacts it, and then remounts it. This seemed to work fine, but because the program indicates that before copying but after mounting the disk it does things ('preparing' it, preserving the Spotlight state, etc.), I was concerned that unmounting it after those things might cause problems, so I changed my script to just perform the 'compact' command after the backup. So far, so good... I'll post here again if after a number of repetitions some problem crops up.



All times are GMT -4. The time now is 06:28 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2022, vBulletin Solutions, Inc.