PDA

View Full Version : [SD] Sparse Image 'size creep'


mr.hood
08-02-2007, 07:16 PM
Hello all,

Here's my query...

I back up my main HD (which at present is using ~ 18gb), I run SD using Smart Backup (this usually takes around 5 minutes), my final backup image weighs in at around 22.4gb.

Why is there this size increase?

It seems to happen every time (a size increase), even if not much has changed.

Apologies if this is a silly question, I am just curious.

dnanian
08-02-2007, 07:35 PM
It's the way Apple manages free space inside a sparse image. They tend to expand the external size before they re-use internal space...

mr.hood
08-02-2007, 07:49 PM
It's the way Apple manages free space inside a sparse image. They tend to expand the external size before they re-use internal space...
Ahh, that makes sense. Thanks for the quick reply.

rdlsmith
08-10-2007, 02:49 AM
True but you can also compact the image file.

hdiutil compact '/Volumes/<drive>/<path>/backup.sparseimage'

jjj
08-22-2007, 05:12 AM
True but you can also compact the image file.

hdiutil compact '/Volumes/<drive>/<path>/backup.sparseimage'

I found the same suggestion elsewhere online, but this is failing for me:
"hdiutil: compact failed - Device not configured"

Are we sure this is supposed to work, and (separate question) if so, could/should this be default behavior when doing a Smart Update?

dnanian
08-22-2007, 09:49 AM
Yes, this definitely works. It sounds like you didn't point at the (unmounted) file.

While it could be the default behavior, I don't think it should be. It's quite slow and isn't generally necessary...

jjj
08-22-2007, 09:39 PM
It was indeed unmounted. I have six of them, Sunday through Friday -- Saturday gets the Mirror. The Smart Updated images are backups of my home folder, which is about 3.5 gig. The images now range from 9 to 12 gig, so I'm looking for a nice way to size them back down. This is what I get:

>hdiutil compact Tuesday.sparseimage
hdiutil: compact failed - Device not configured

Nothing's mounted but the drive the images are on.

dnanian
08-22-2007, 09:56 PM
I honestly have no idea what would cause that. It indicates that something -- likely in the track to the image -- is failing. But the message is Apple's, and it's obscure enough that I'm not sure what it's referring to.

Is there more detail in the system.log?

jjj
08-23-2007, 01:50 AM
Nothing shows up in /var/system.log.

I did finally find this:
http://www.macosxhints.com/article.php?story=20041207153823222

(via shirt-pocket.com forums here, incidentally:
http://www.shirt-pocket.com/forums/archive/index.php/t-577.html)

For whatever reason, using the AppleScript actually does perform the compaction. But running that same hdiutil command in bash doesn't. I just don't understand that.

Also, I get this message in system.log:

diskimages-helper[7433]: compaction returned error 0\n

That's a literal "\n" at the end of the line. I'm hoping I can interpret that as error code zero, meaning no error.

dnanian
08-23-2007, 10:21 AM
I don't understand that either. Weird.