Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

fdw777

macrumors regular
Original poster
Mar 7, 2012
238
179
I need some help understanding the difference between the two (Sparse Bundle Disk Image (SBDI) vs Sparse Disk Image(SDI)).

Example: If I make an Image say 200MB's each and I put a file in each one that's say 50MB's and over time (say 3-6 months) that same file grows to 75MB's.
Question: Will each eventually expand EQUALLY or will the SBDI fill faster than the SDI?

I've always used SDI over SBDI because the idea that the SDI will not exceed the given Disk size ie., 200MB's.

I think I need a better understanding...Thanks for all your help!
 

Sydde

macrumors 68030
Aug 17, 2009
2,563
7,061
IOKWARDI
There is no practical difference. A SDI is a sparse file, which means it sees virtual data in the file in specific locations but the parts that are absent are not allocated. A sparse file might have a only megabyte of data stored where the program sees it at the virtual 2Gb position but the rest of the file is not actually allocated so it only takes up a megabyte.

A sparse bundle disk image works basically the same way, but it is a bundle instead of a single file: a folder containing individual files, disguised as a file. Applications and RTFDs, for example, are bundles.
 

chown33

Moderator
Staff member
Aug 9, 2009
10,998
8,887
A sea of green
For a single file on the disk image, the two formats are probably roughly similar. I can't think of any clear advantage one would have over the other.

Here's a summary explaining differences between the two formats:

The differences only become signficant when there are files on the disk image that are updated. Under that scenario, a sparseimage will show the entire single image file being modified, while a sparsebundle will only modify the 8MB bands which hold modified data.

An example can illustrate the significance of this. Suppose you have a disk image with 10 files. You add 1 file of 20 bytes. In a sparseimage, the diskimage file may grow slightly or stay the same size, but the entire diskimage file will be modified. So if you were to back it up, the backup app would need to read and write the entire file. Conversely, in a sparsebundle, only the 8MB band-files for the directory entries and the location of the data will be modified. A backup app will see at most 2 or 3 modified 8MB band-files, and only those will need to be copied to the backup media. Time Machine, for example, would use hard-links on all the band-files that were unchanged.

In the example you gave, which has a single file growing from 50MB to 75MB, both formats will grow from roughly 50MB of disk space to 75mB of disk space. The main difference will be in any backups of those diskimages. A sparse image will have a complete copy of the entire sparseimage file for every backup. A sparse bundle will have a complete copy only of the 8MB band-files that changed. If the file data is very different for each backup, then many or all the band-files will change, and a sparse bundle has no advantage over a sparse image. However, if the first 50MB of the file remains unchanged, then the sparsebundle's backups will only have the differences from the prior backups.

This may be affected by the format of the disk image, i.e. whether it's HFS+ or APFS. I'm not familiar with exactly how APFS expands the space allocation for a single file, so it might be worthwhile to do your own testing to see if there are any differences. That is, make sparseimage and sparsebundle in both HFS+ and APFS formats, then copy a 50MB example file to each. Grow the file to 75MB, and see what happens to the size of the diskimage.
 
  • Like
Reactions: Sydde

Rivvvers

macrumors regular
Jun 11, 2012
115
121
The Shire
Which type is best for backup? because thus far I have been using sparse bundle images, but recently they wont mount "Failed to mount Filesystem / There are no mountable filesystems in the the disk image" is there any adverse reason not to use sparse images for backup?
 

Basic75

macrumors 68020
May 17, 2011
2,101
2,448
Europe
There is no practical difference.
Aren't sparse disk images only supported on filesystems that support sparse files? And weren't sparse sparse bundle disk images created to circumvent that limitation, and also to allow copying and archiving with software that is not sparse file aware? IMHO these are important practical differences.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.