Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Make Time Machine use a Local Volume as a Network Volume Network
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.
  • Use the System Preferences > Sharing > File Sharing facility to create a shared folder on any local volume. This folder will hold your Time Machine backups.
  • From an administrative account, open a terminal window and enter this command to create a loopback alias to the 127.0.0.2 IP address:
    # sudo ifconfig lo0 alias 127.0.0.2/32
      
  • Verify the loopback alias was created by looking for the 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
      
  • Use the Finder Go > Connect To Server menu command to connect to the server: 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.
  • Use the System Preferences > Time Machine facility to add the mounted shared volume as a Time Machine backup destination. Once this is done you can eject the shared volume from the desktop. Time Machine will mount and eject the volume automatically when needed in the future.
  • To create the loopback alias address each time the machine is booted, create a Launch Daemon property list file located at /Library/LaunchDaemons/my.domain.loopback.plist with this content [crarko adds: Note: Don't add the raw2 tags shown below. That's a bit of Geeklog formatting and not part of the plist file.]:
    [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]
Now Time Machine will happily back up to a sparse disk image bundle on the local shared folder or volume. I've been using this solution for a few months now, including successfully restoring several items from my backups, without any apparent issues.

[crarko adds: I haven't tried this particular method, but have seen similar things in the past. I'd suggest making a completely separate clean, full, backup first before making any modifications, just in case. I tried to preserve the original formatting of this hint as much as possible, which introduced on artifact noted in the body above. Let me know if there are any others. Thanks.]
    •    
  • Currently 3.17 / 5
  You rated: 3 / 5 (6 votes cast)
 
[6,763 views]  

Make Time Machine use a Local Volume as a Network Volume | 9 comments | Create New Account
Click here to return to the 'Make Time Machine use a Local Volume as a Network Volume' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Make Time Machine use a Local Volume as a Network Volume
Authored by: davidkisley on Mar 11, '14 08:41:33AM

Would it not be easier to just create a sparse disk image, with disk utility, and mount it and select it as time machine backup? I do not have a way to test, but I do not see why this would not work.

---
2.7 i7 Mini 8G Ram 256-SSD - new iPad - iPhone 5 Soon!



[ Reply to This | # ]
Make Time Machine use a Local Volume as a Network Volume
Authored by: dfbills on Mar 11, '14 02:35:42PM

I use a local sparsebundle on several of my machines. No special modification necessary.

---
-d



[ Reply to This | # ]
Make Time Machine use a Local Volume as a Network Volume
Authored by: jollyroger on Mar 13, '14 12:21:08PM

As a test, in Mac OS X 10.9, I just:

1. created a new sparsebundle disk image (hdiutil create -size 500G -type SPARSEBUNDLE -fs HFS+J -volname "Time Machine Backup" test.sparsebundle),
2. mounted the new disk image by double-clicking it in Finder,
3. opened System Preferences > Time Machine,
4. clicked "Add or Remove Backup Disks"

The mounted disk image was absent from the list of backup destinations. I've seen this behavior in many past Mac OS X releases as well.

---
Jolly Roger



[ Reply to This | # ]
Make Time Machine use a Local Volume as a Network Volume
Authored by: dfbills on Mar 13, '14 12:36:33PM
I believe you also need to enable unsupported network volumes:

defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

And the image needs to be named with the following convention:

"name of your computer" _ "mac address"

Laptop _ 12:0c:cf:dc:b6:26

Final name: Laptop_120ccfdcb626.sparsebundle
---
-d


[ Reply to This | # ]
Make Time Machine use a Local Volume as a Network Volume
Authored by: jollyroger on Mar 13, '14 01:02:25PM

I just tried it:

* the computer name is "server"
* the MAC address of primary Ethernet interface is "23:cd:e9:21:4f:fd"

Here's what I did:

1. renamed the image server_23cde9214ffd.sparesebundle
2. set TMShowUnsupportedNetworkVolumes to 1
3. restarted the machine just to be sure the change would take effect
4. double-clicked the image to mount it
5. opened System Preferences > Time Machine and clicked "Add or Remove Backup Disk"

Still, the mounted volume does not appear in the list.

I even set the *mounted* volume name to "server_23cde9214ffd" (it was "Time Machine Backup" previously), and it still does not appear in the list.

---
Jolly Roger



[ Reply to This | # ]
Make Time Machine use a Local Volume as a Network Volume
Authored by: patrickfergus on Mar 11, '14 09:08:01AM
Some thoughts about this hint:
This introduces obstacles to anyone wishing to make copies of a Time Machine volume.
Apple's KBase article HT5096 ("Time Machine: How to transfer backups from the current backup drive to a new backup drive") says drag and drop copy of an existing Time Machine backup should be OK, as long as the target disk is formatted appropriately. However a sparseimage backup would be more flexible when copying existing backups to not-appropriately-formatted volumes.
Unfortunately, Time Machine will not back up to a local directory, but instead requires an entire volume be dedicated to backups.
Time Machine doesn't require the backup volume to only contain backups--other data can be stored on the volume beyond the backups. Or is this statement saying "the only thing Time Machine will back up to is a hard drive (volume) or a network-based Time Machine share, and I want it to back up to a specific folder on a specific drive"?
Further, Time Machine will utilize as much free space as possible on the volume.
This is also true for network-based/sparseimage backups--they will expand to fill up the file share. However one could set up quotas to limit the size of backups. Can the hint poster expand on the goal(s) for this hint?

[ Reply to This | # ]
Make Time Machine use a Local Volume as a Network Volume
Authored by: hamarkus on Mar 11, '14 03:49:43PM

"Time Machine doesn't require the backup volume to only contain backups--other data can be stored on the volume beyond the backups. "

(1) TM requires to be located at the root of a volume (you can only select a volume as the destination in the preferences, not a folder on a volume which in effect cause the TM backup to always be at the top level of volume).

(2) Unless you manually delete older TM backups, TM will fill up the target volume completely eventually. Which in the end means that the volume gets turned into an almost read-only volume for other data because you can only read (or delete/move) other data from it but cannot put other new data onto it because the volume will be filled to close to capacity. Of course, you can always manually delete the oldest backups when you need more space for other data but it is an extra step that has to be repeated periodically.



[ Reply to This | # ]
Make Time Machine use a Local Volume as a Network Volume
Authored by: jollyroger on Mar 13, '14 12:10:57PM

To my knowledge, Time Machine will back up to:

* a local volume
* a shared network volume

but Time Machine will not back up to:

* a folder on a local volume
* a locally mounted sparsebundle disk image

While it may be true that you can make a file copy of the "raw" file system of a Time Machine backup destination from one GUID HFS-Journaled file system to another GUID HFS-Journaled file system, a sparsebundle disk image is a much safer option when you may be dealing with various different types of file systems or different transfer methods, since it is completely self-contained. This is why I personally prefer to back up to disk images as opposed to "raw" file systems.

You can limit the size of Time Machine sparsebundle disk images such that Time Machine cannot expand them past their current size by locking the Info.plist files within the bundle (chflags uchg backups.sparsebundle/Info.*). I suppose I should have included this in the hint (though I believe it's already been posted elsewhere). Also, as suggested, you can use various methods to set up quotas for local shared folders. For instance, if you have Mavericks Server installed, you can set individual quotas for shared Time Machine backup destinations in the Time Machine setup panel.

---
Jolly Roger
Edited on Mar 13, '14 01:08:53PM by jollyroger



[ Reply to This | # ]
Make Time Machine use a Local Volume as a Network Volume
Authored by: satcomer on Mar 29, '14 09:15:32AM

I have heard several people using the steps in the blog post: http://rajiv.sg/blog/2012/11/19/configuring-os-x-mountain-lion-time-machine-to-work-with-cifs-smb-share/ (Configuring OS X Mountain Lion Time Machine to Work With CIFS (SMB) Share).



[ Reply to This | # ]