How To Synchronize with a Disk Image in ChronoSync 4.7
Table of Contents
ToggleINTRODUCTION
ChronoSync can perform a synchronization (or backup) between any block device that can be mounted on your desktop. This usually means USB, FireWire, Thunderbolt, Flash and SD drives, or file servers. Another form of mountable “media” that is easy to overlook, however, is a Disk Image.
Disk Images are usually referred to by their filename extension, “DMG”. They are basically data files that mimic storage devices. The contents of these files are complete file systems and macOS can mount these file systems as regular volumes.
Typically, disk images are used to distribute data and applications (such as ChronoSync). However, you can create your own disk image and make it writable, thus allowing it to be specified as a destination target. Furthermore, ChronoSync identifies a disk image as removable media so you can have ChronoSync mount it automatically and unmount it when finished. You can even schedule a “sync-on-mount” to be performed whenever you manually mount a disk image file.
ATTRIBUTES OF DISK IMAGES
Why a Disk Image? There are actually many situations where using a disk image is advantageous – too many, in fact, to list here. We’ll touch upon some uses at the end of this guide. First, however, you must understand the two most useful attributes of disk images.
Disk Images Can Be Formatted As HFS+
The file system that macOS prefers to use is HFS+ (also called HFS Extended). It offers the ability to store and manage files in a distinctly Mac way, i.e. very long file names, few character restrictions, hidden extensions, rich meta data, resource forks, etc. Sometimes, however, you are forced to synchronize with a non HFS+ file system, such as Windows. This imposes many restrictions – you can either live with them, or create a disk image and place it on your non-HFS+ file system. You then won’t have any problems copying your data to an alien file system.
DMGS Can Be Mounted with Full Access Privileges
The default method for mounting disk images will result in the user having full ownership privileges of all the files and folders contained therein. Thus when scanning a mounted disk image, and copying data to/from it, there will be no permission related errors. The implications of this become huge when you realize that anyone who mounts a DMG will have full access. This allows you to share your data with other users without having to worry about access restrictions. This can be invaluable when synchronizing with a “central repository” that you need several users to have access to.
DMGS Can Be Encrypted
If you want your data to be secure you have the option to encrypt and password-protect your DMG. This may be a bit overly cautious but if your DMG can be accessed by an unauthorized person then it’s a wise precaution.
CREATE A DMG
Several utilities are available, but the one that comes with macOS, Disk Utility, is what we will use.
Launch Disk Utility from /Applications/Utilities. Choose “File->New Image->Blank Image…”. In the dialog that appears, you must specify a few pieces of information:
- The name and location are completely up to you. A disk image, once created, can be copied anywhere.
- The volume size should be large enough to handle the data you are synchronizing or backing up. For this guide, we’re choosing 4.7 GB, which is a typical DVD capacity.
- The format should be “OS X Extended (Journaled)”, the Mac native filesystem.
- The image format should be “sparse bundle disk image”. Although any of the options will work, this is the best option. This indicates that the file itself will NOT be 4.7 GB in size, and will only grow as necessary.
- Choose Encryption if you want to password-protect your data inside and prevent unauthorized access to your files. Encrypting your data will convert the data into unreadable code. Note: This password can be added to your keychain or in “Target Options” under the Setup Panel of the Synchronizer document.
Click “Save” when ready.
SETUP YOUR TARGETS
Disk Utility should have mounted the disk image automatically after creating it. A new volume with the name you specified should appear on the Desktop, just like an external drive.
Next, launch ChronoSync and specify your targets as you would normally do. In this example, we are creating a unidirectional sync with the source (left) target being the users “Documents” folder, and the destination (right) target being the newly created disk image.
To select the disk image as your destination choose the mounted volume of the disk image for the Target.
If the disk image volume is not mounted check “Allow disk image file selection” in the file navigation window while choosing the sparse bundle disk image file you created as your target.
SPECIFY MOUNTING OPTIONS
You’ll notice that the “Options” button is available for the disk image target. This is because ChronoSync identifies the disk image as removable media. You can thus specify the same mounting options you would have if this media resided on a removable device.
Depending on the nature of your backup, you may not need or want to modify any of the mounting options. In this case, we will instruct ChronoSync NOT to prompt for mount, attempt to mount the disk image, and to “eject” the disk image when synchronization is complete.
The “Prompt if disk image is not mounted” option is disabled because we don’t want to be asked to insert the media if it is not mounted. ChronoSync will attempt to automatically mount the DMG. If that fails, the DMG simply isn’t available.
If your DMG is encrypted, you can supply your encryption key/password so that ChronoSync will automatically mount. Otherwise you’ll be prompted each time the DMG attempts to mount. Supplying the encryption key is more secure than if the password is on the keychain. When on the keychain, any application can mount that disk image. In this instance, only ChronoSync can mount it.
The “Eject disk image after synchronization” option is turned on because we will only be using this media for backup. When backup is complete, we want to immediately unmount it. This will prevent the user from “tinkering” with the contents of the disk image. In a shared environment, this will also allow the DMG to be mounted by another user.
RUN YOUR SYNCHRONIZATION
When complete, the disk image will be ejected and the mounted volume will disappear from the desktop.
WHAT IS IT GOOD FOR?
Synchronizing to Windows or Linux file servers which do not support the HFS+ file system. This allows you to preserve all file attributes, including Mac-style filenames such as “Research ƒ”. This even means you can create a clone of your Mac hard drive directly onto any other computer system.
Sharing data with other users on a file server, or even your own machine (if you have multiple accounts). Normally, synchronizing to a common folder doesn’t work because files retain the ownership of those who created them. Thus other users may be able to view your files but might not be able to modify them. With a DMG, whoever mounts the disk becomes the “owner” of all files.
Burning to CD or DVD. By choosing a DMG size that matches the capacity of a CD or DVD, you can quickly burn the disk image and be sure all your data will fit. This isn’t the case if burning from a folder. Also, it’s easy to setup a post-synchronization AppleScript that will do this automatically!
Safeguarding your data. By enabling encryption, you can restrict access to your data. This will protect the data from users who you want to block and, also, keep the data safe in the event of theft.
“Efficient Backup of your Backup” when copying over the internet or to any cloud service. When you backup a sparse bundle disk image, the files contained are not backed up individually. Instead, entire sections of the sparse bundle disk image called ‘bands’ are copied. This is so much more efficient and faster than copying files one by one. Check out the “Effective Cloud Strategies” guide for more information.
SOME IMPORTANT INFORMATION
Mounting a DMG that is located on a file server, while providing access to a remote file system that can efficiently store all file attributes and metadata, does pose some risk. If the connection with the file server is ever lost for some reason, the data on the DMG could become corrupt. It should only be used on “reliable” network connections. Also, if by chance connection is ever lost with a server hosting a mounted DMG, Disk Utility should be run on the DMG after restoring the connection.
If the destination is a Mac, remote mounting of a DMG via a ChronoAgent connection is exactly like mounting the DMG locally except the mount is occurring on the remote machine. It is much safer than mounting a DMG across a file server connection since breaking the network connection won’t run the risk of corrupting the DMG. It is also much higher performance. DMGs can be mounted “hidden” so remote users of the machine won’t even notice the DMGs coming and going.
WHEN THINGS GO WRONG
For most people, the above steps will work flawlessly for creating a disk image and synchronizing to it. However, we live in an imperfect world and sometimes things just don’t work out as expected. If you encounter any problems following this tutorial, here are some tips that may help you get back on track:
Apple Help
From the “Help” menu in Finder, you can try the following search terms (minus the quotes):
- “Create a disk image using Disk Utility”
Technical Support
Contact our technical support team and just ask! We don’t mind — we’re here to help!