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


Click here to return to the '10.5: Reconnect Time Machine backup after drive swap' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: Reconnect Time Machine backup after drive swap
Authored by: cleeland on Jan 04, '10 10:15:16AM
I found that this hint was insufficient to reconnect my migrated-to hard drive to my existing backups.

The first thing missing was that in addition to replacing the UUID in the SnapshotVolumeUUID xattr, I also needed to replace the UUID in the SnapshotVolumeFSEventStoreUUID xattr. The UUIDs, however, are different.

The UUID required for SnapshotVolumeFSEventStoreUUID comes from /Volumes/my-volume/.fseventsd/fseventsd-uuid, e.g.,


bash-3.2# cat /Volumes/bobke2/.fseventsd/fseventsd-uuid 
C422D468-07D4-4669-A9D8-5D3665B3D091bash-3.2#

NOTE:the UUID ends in "1" above, just before the 'b' in the bash prompt.

Also, the value for these attributes appears to require the trailing zero byte. I could not figure out how to get the xattr command to add that zero byte, so I wrote the following C program to do it using the setxattr() call. If you do not know how to compile and run a C program then this may not be for you. Use this at your own risk; I assume no risk and make no promises. I will not provide binaries.


#include <sys/xattr.h>
#include <stdio.h>
#include <string.h>

/*
     int
     setxattr(const char *path, const char *name, void *value, size_t size,
         u_int32_t position, int options);
*/

int main(int argc, char* argv[])
{
  if (argv[1] == 0 || argv[2] == 0 || argv[3] == 0) {
    printf ("usage: setxattr path attrname value\n");
    return 1;
  }

  const char* path = argv[1];
  const char* name = argv[2];
  void* value = argv[3];
  size_t v_len = strlen(argv[3]) + 1;

  int r;

  r = setxattr(path, name, value, v_len, 0, 0);
  if (r != 0) {
    printf ("setxattr failed\n");
  }

  return (r != 0);
}

Finally, I did not find a need to set the attributes anywhere except under the Latest backup.

After updating the two attributes with their respective UUIDs I was able to complete an incremental backup rather than a completely new one, and all was good.

[ Reply to This | # ]

10.5: Reconnect Time Machine backup after drive swap
Authored by: only_solutions on Jan 05, '10 06:32:13AM

As far as I know, the SnapshotVolumeFSEventStoreUUID is only for optimization:

If it is present and if it is a match to the FSEvent database on the working volume, the deep traversal can be omitted and only the recorded events will be used for a quick backup.

If you don't touch it while reconnecting Time Machine, it will indeed do a deep traversal of the entire working volume (the new one in this case) because it finds no match.

So the first backup will take longer, it may also (incorrectly!) predict a relatively large size of that snapshot but in the end it seems to be just fine after all – at least that was my experience when I migrated from my PowerMac G5 under Leopard to my iMac i7 under Snow Leopard (see my previous post above).

Did you already abort the first snapshot when it entered deep traversal or when it initially displayed an unexpectedly large backup size? Or did you let it run its course and the new snapshot was in fact full-sized?

The latter should not be the case – the first backup will just take longer, but if you didn't change the arrangement of the folders on your volume, the incremental backups should remain small.

And in my experience the trailing zero termination for strings is set automatically by the xattr tool when using it as described, so I did not have a problem with that.

Tweaking the latest backup does indeed seem to be sufficient, as described. ("Latest" in the backup folder is just an alias of the actual snapshot, normally the one with the most current timestamp as its name.)

---
There are no problems...
Edited on Jan 05, '10 06:42:23AM by only_solutions



[ Reply to This | # ]