For the purposes of archival uploading to Google Drive/Dropbox/Etc, what are the differences between DMG and SparseImages

disk-utilitydmghard drivesparsebundle

I recently have a large amount of data I needed to upload into Google Drive. I decided to use Disk Utility to create a container for it (otherwise Google Drive would have to create many files and directories taking up a huge amount of the time).

I noticed that Disk Utility creates a read-only DMG file by first creating a sparseimage, then converting it to a DMG file.

As a result, to cut down on time, I am wondering if creating sparseimages of my files, then uploading to Google Drive is better than putting it into a DMG file. My two main concerns are:

1) I read somewhere that sparseimages seem to have a greater than of being corrupt on Google Drive or cloud services?

2) Is there any real difference between the two beyond write/read-only capabilities?

Best Answer

From Wikipedia:

A sparse image is a type of disk image file used on macOS that grows in size as the user adds data to the image, taking up only as much disk space as stored in it. Encrypted sparse image files are used to secure a user's home directory by the FileVault feature in Mac OS X Snow Leopard and earlier. Sparse images can be created using Disk Utility.

Unlike a full image file (.dmg), which takes up as much actual space as the real disk it represents (regardless of the amount of unused space), a sparse image file (.sparseimage) takes up only as much actual disk space as the data contained within, up to a maximum of the capacity assigned during creating.

https://en.wikipedia.org/wiki/Sparse_image

In your case, because you don't indicate you plan to use the utility of the sparseimage mechanism in any way to create an expansible, or 'live' storage container, creating .dmg files would be called for because they are monolithic files best use for archiving.

If the data is already indexed or organized in some way, then creating separate .dmg files make a logical container to extend and reinforce that organization. Ex: TaxDocuments2010.dmg, TaxDocuments2011.dmg, etc.

Google has a max size of 5TB per single non-Google document file, BTW.

Lastly, you may wish to package this data in a non-Apple proprietary format such as tar or GZIP so it can be opened on other platforms.