If you clone a volume that you backup with Time Machine, its UUID will change and Time Machine will no longer be able to make backups of it. However, it won’t tell you directly what the problem is. Rather, you will find entries like the following in /var/log/system.log:
backupd Backup failed with error: 12
backupd Error (12): Link of previous volume failed for macosx.
If you want to continue to backup to the same volume in your Time Machine backup database, the following script allows you to change the UUID of the existing backups, leading Time Machine to backup as if the volume’s UUID had never changed.
Note
In OS X Lion 10.7, there is a nifty new command line utility called tmutil, which takes care of the task previously accomplished by the script described below.
From its man page (man tmutil):
associatedisk [-a] mount_point snapshot_volume
Bind a snapshot volume directory to the specified local
disk, thereby reconfiguring the backup history. Requires
root privileges.
In Mac OS X, HFS+ volumes have a persistent UUID that is
assigned when the file system is created. Time Machine uses
this identifier to make an association between a source vol-
ume and a snapshot volume. Erasing the source volume creates
a new file system on the disk, and the previous UUID is not
retained. The new UUID causes the source volume -> snapshot
volume assocation to be broken. If one were just erasing the
volume and starting over, it would likely be of no real con-
sequence, and the new UUID would not be a concern; when
erasing a volume in order to clone another volume to it,
recreating the association may be desired.
A concrete example of when and how you would use
associatedisk:
After having problems with a volume, you decide to erase it
and manually restore its contents from a Time Machine backup
or copy of another nature. (I.e., not via the Mac OS X
installer's System Restore feature or Migration Assistant.)
On your next incremental backup, the data will be copied
anew, as though none of it had been backed up before. Tech-
nically, it is true that the data has not been backed up,
given the new UUID. However, this is probably not what you
want Time Machine to do. You would then use associatedisk to
reconfigure the backup so it appears that this volume has
been backed up previously:
thermopylae:~ thoth$ sudo tmutil associatedisk [-a] "/Vol-
umes/MyNewStuffDisk" "/Volumes/Chronoton/Backups.back-
updb/thermopylae/Latest/MyStuff"
The result of the above command would associate the snapshot
volume MyStuff in the specified snapshot with the source
volume MyNewStuffDisk. The snapshot volume would also be
renamed to match. The -a option tells associatedisk to find
all snapshot volumes in the same machine directory that
match the identity of MyStuff, and then perform the associa-
tion on all of them.
Note
Mac OS X 10.6 Snow Leopard has ACLs enabled by default and therefore ships without the fsaclctl command line tool that we need to temporarily turn off ACLs. You may try to grab it from a Leopard DVD:
http://porkrind.org/missives/how-to-get-fsaclctl-off-your-leopard-install-dvd/
Use this at your own risk!
Usage Example
1 2 3 4 5 6 7 8 9 10 | |
Script
And here’s the script.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
Save the above code to a file called e.g. timemachine-setuuid.sh and make that file executable by issuing
1
| |