Macworld Forums: Disk Image vs. Sparse Disk Image vs. Sparse Bundle Disk Image - Macworld Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Disk Image vs. Sparse Disk Image vs. Sparse Bundle Disk Image

#1 User is offline   SSGoku Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 224
  • Joined: 14-May 04

Posted 20 April 2008 - 08:32 AM

When creating a blank disk image in 10.5.2, I've noticed that there are three options for image format: Read/Write Disk Image, Sparse Disk Image and Sparse Bundle Disk Image.

I know what a disk image is and have used the regular read/write disk image on several occasions, but I'm curious to know more about the sparse alternatives and what they are used for.

What is a Sparse Disk Image and what is a Sparse Bundle Disk Image?

thanks
0

#2 User is offline   Typhoon14 Icon

  • Veteran
  • PipPipPip
  • Group: Members
  • Posts: 2,391
  • Joined: 02-February 01

Posted 20 April 2008 - 01:37 PM

A sparse disk image is an automatically expanding disk image. In other words, you can create a 50 gigabyte sparse disk image, yet only put 5 megs inside it. The disk image will only take up five megs of space on your harddisk, but will be capable of storing up to 50 gigs of data should you choose to add it. Note that it auto-expands but does not auto-contract. In other words, if you delete files from the image, you will not regain any free space on your harddisk (although you will on the image). Disk Utility can be used to "shrink" a sparse image, reclaiming any unused space on the image.

A sparse bundle is essentially the same thing, the only difference is that while a sparse image is one giant file on your disk, a sparse bundle is actually lots of small files (8 megabytes each). They work and look the same way, but you can right-click on a sparse bundle, select "show package contents" and see the individual 8 meg "bands".

The sparse bundle was introduced with OS 10.5 in order better support Time Machine (Especially with FileVault, where the entire home directory is a sparse bundle). Previously, a backup programme would see the image as one file, and if any changes had to been made to it, it would have to recopy the entire image. With sparse bundle, it can only copy the bands that have been changed since the last backup, so the backups are much quicker. It also is likely to decrease the chance of data loss, as you could conceivably restore parts of a damaged image.

Basically, if you want a sparse image, use the sparse bundle under 10.5. Only use the sparse image if you need backwards-compatibility with earlier versions of the Mac OS.
0

#3 User is offline   DAWproject Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 05-July 08

Posted 21 April 2009 - 04:52 AM

Hello,

Would you please explain exactly how "Disk Utility can be used to "shrink" a sparse image, reclaiming any unused space on the image." ..?

Thanks
:)
0

#4 User is offline   Typhoon14 Icon

  • Veteran
  • PipPipPip
  • Group: Members
  • Posts: 2,391
  • Joined: 02-February 01

Posted 22 April 2009 - 04:29 PM

It looks like I may have erred in regards to claiming that you could shrink a sparseimage/bundle with Disk Utility. That said, it's still really easy to do. Just fire up Terminal and enter the following

hdiutil compact /path_to/yourimage.sparseimage

Or just hdiutil compact, then add a space and drag the image into the Terminal window to complete the path.
0

#5 User is offline   Martian Icon

  • Veteran
  • PipPipPip
  • Group: Members
  • Posts: 1,568
  • Joined: 27-September 01

Posted 23 April 2009 - 06:44 AM

Great explanation, Typhoon14.

Is there a significant difference in access speed, reliability, or other factor between the three image types when using encryption? In other words, other than for backward compatibility, is there any reason not to use a Sparse Bundle Disk Image?
I use encrypted disk images for personal data, and with the drive sizes available today, space efficiency is not really a priority with these file types.
0

#6 User is offline   Typhoon14 Icon

  • Veteran
  • PipPipPip
  • Group: Members
  • Posts: 2,391
  • Joined: 02-February 01

Posted 23 April 2009 - 10:57 AM

There should not be, and I myself have never experienced one (I use FileVault so have had lots of experience running the entire OS using both sparseimages and sparsebundles). In fact, if anything, breaking it into bands should increase reliability (if a single bands is corrupted, you may still be able to access your other data or even restore the damaged band from a backup), and in theory not having to write all data to one enormous file could yield performance increases when working with large images (I have not noticed a difference one way or another).
0

#7 User is offline   Martian Icon

  • Veteran
  • PipPipPip
  • Group: Members
  • Posts: 1,568
  • Joined: 27-September 01

Posted 23 April 2009 - 06:30 PM

Thanks
0

#8 User is offline   winglet Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 22-September 09

Posted 22 September 2009 - 12:31 AM

Typhoon14,

Thanks for the really great breakdown on sparse bundle images, found it with Google.

Just to expand on the idea that one could theoretically restore part of a sparse bundle by using a back up of a "band", are there any utilities out there that would actually allow this? ie, allow you to identify a bad band within an image and replace it individually? Just trying to understand how this could work in practical terms. I suppose you could do error-checking/comparison from within Terminal on a band-by-band basis but obviously that's not practical on a very large file.

I don't presently have any issues, but in the future as my data storage grows ever-more enormous I could see the ability to repair something by using a partial method would be extremely valuable.

rgds,
winglet
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

3 User(s) are reading this topic
0 members, 3 guests, 0 anonymous users