This procedure shows you how to prevent Time Machine from using all available free space on a local volume by backing up to a sparse disk image bundle stored on a shared folder on a local volume.
Time machine uses a feature of the HFS+ filesystem that was introduced in Mac OS X 10.5 (Leopard) called 'directory hard links.' Like file hard links, a directory that is hard linked to another directory is not actually a distinct directory, but is instead a pointer to the original directory. Time Machine uses these directory hard links to reduce duplication and save space by making references to entire directory trees whose contained files have not been modified.
To properly copy or duplicate a Time Machine backup, these directory hard links must be preserved. Unfortunately, directory hard links are proprietary to Apple. Apple discourages their casual use by third party developers because, if used incorrectly, they could create recursive directory structures that would render a volume effectively useless. This introduces obstacles to anyone wishing to make copies of a Time Machine volume.
Time Machine may be configured to back up to a local volume that is connected directly to a Mac (either internally, or externally with a Firewire or USB connection), where it creates a Backups.backupdb folder at the root of the volume, storing all of the backup data in the volume's native file system using the previously mentioned directory hard links. Unfortunately, Time Machine will not back up to a local directory, but instead requires an entire volume be dedicated to backups. Further, Time Machine will utilize as much free space as possible on the volume. To prevent Time Machine from filling a disk, you could partition the disk to create multiple volumes, dedicating only one of the partitions to Time Machine backups. Yet you would still have no easy way to copy the backup data off the partition, due to the directory hard links.
Time Machine may also be configured to back up to volume that exists on a remote Mac and is mounted locally as a shared network volume. In this configuration, Time Machine creates a sparse disk image bundle which contains its own internal file system where backup data is stored. Since the backup data (with directory hard links) is stored within a self-contained disk image, one can easily make a copy of the entire disk image without worrying about effecting the directory hard links contained within the disk image. For this reason, backing up to a shared volume could be preferable for those who don't want to dedicate an entire volume to backups, or who want to be able to easily make file system level copies of the backup data for added security.
This procedure shows you how to prevent Time Machine from using all available free space on a local volume by backing up to a sparse disk image bundle stored on a shared folder on a local volume. You can make an AppleShare network connection to the same machine by adding an extra IP address to the local loopback interface as an alias. This allows you to treat any local directory or volume as if it were a remote shared network volume, so that Time Machine will create a sparse disk image bundle on it which can easily be copied.
# sudo ifconfig lo0 alias 127.0.0.2/32
127.0.0.2 address in lo0 interface section of the ifconfig output:# ifconfig lo0 lo0: flags=8049 mtu 16384 options=3 inet6 ::1 prefixlen 128 inet 127.0.0.1 netmask 0xff000000 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 --> inet 127.0.0.2 netmask 0xffffffff nd6 options=1
afp://127.0.0.2, and select and mount the shared folder you created. You should see the shared folder mounted as a shared volume icon on the desktop.[raw2] <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>my.domain.loopback</string> <key>Disabled</key> <false/> <key>RunAtLoad</key> <true/> <key>ProgramArguments</key> <array> <string>/sbin/ifconfig</string> <string>lo0</string> <string>alias</string> <string>127.0.0.2/32</string> </array> </dict> </plist> [/raw2]
Mac OS X Hints
http://hints.macworld.com/article.php?story=20140308141622774