How do I get Time Machine working again after changing my hard drive?

5

2

On my Mac, I recently

  • changed to a new hard drive (e.g. after a hard drive failure) or
  • migrated the boot partition to another one

What do I have to do to get Time Machine correctly backing up my data again? It is no longer doing incremental backups.

slhck

Posted 2011-10-04T20:00:23.307

Reputation: 182 472

See also Apple's Mac OS X 10.5: Time Machine performs full backup after a full restore.

– Arjan – 2011-10-04T20:28:23.463

Answers

4

0. Notes

First, disable Time Machine. Then, make sure you have a backup of your important stuff and don't solely rely on the Time Machine disk. You can break things here.

Also note that you should only do this if you want to have incremental backups again. If you don't care about your previous backups, you can skip this thing and just let Time Machine create a second one.

1. Prerequisites

Anyway: You need the fsaclctl command for the following steps. If you are on Snow Leopard, you can get it from the Leopard install disk. On Leopard, it is included already (skip to the next part).

You can also download a package here or here. Extract it, right-click the EnableACLs.app and select "Show Package Contents". Navigate to Contents/Resources and copy fsaclctl to your Home folder (/Users/<your-username>).

2. Find out your new UUID

Open Disk Utility.app, and select Info on your Mac disk. Here, copy your UUID somewhere else. You will need it later.

enter image description here

3. Check your old UUID

Then, open up a terminal and go to the latest backup on your TM disk:

cd /Volumes/<time-machine>/Backups.backupdb/<your-mac-name>/Latest

Replace time-machine> and <your-mac-name> with the name of your Time Machine Volume and your Mac's name, respectively. Now, let's find out the UUID that's currently stored on your disk:

sudo xattr -pl com.apple.backupd.SnapshotVolumeUUID "Macintosh HD"

Replace this with the actual name of your partition (in my screenshot, it was "Macintosh HD"). As you can see, in my case the UUIDs match. In your case, they won't.

If they do, stop here, something else might be the problem!

enter image description here

4. Replace the UUID on the Time Machine volume

You now need to disable ACL protection on the drive using the fsaclctl command.

sudo fsaclctl -p /Volumes/<time-machine> -d

If you've copied it to your Home folder, use this instead:

sudo /Users/<your-username>/fsaclctl -p /Volumes/<time-machine> -d

Now, this is the critical line. You need to overwrite the old UUID to the one of your current disk (i.e. the one found through Disk Utility). Replace the XXX… with the UUID you copied at the beginning.

sudo xattr -w com.apple.backupd.SnapshotVolumeUUID XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX "Macintosh HD"

So this might look like:

sudo xattr -w com.apple.backupd.SnapshotVolumeUUID 650DDECD-CC5E-3552-9960-2D50014A4BDB "Macintosh HD"

After you're finished, re-enable ACL again:

sudo fsaclctl -p /Volumes/<time-machine> -e

As before, if you've just copied it to your Home folder, do this instead:

sudo /Users/<your-username>/fsaclctl -p /Volumes/<time-machine> -e

Don't forget to re-enable Time Machine and see if it works now. Note that the next backup may take a while, even a couple of hours.


I did a similar procedure once, which became necessary after switching the logic board of my Mac.

This is gathered from:

slhck

Posted 2011-10-04T20:00:23.307

Reputation: 182 472

I wonder if it ever applies to changing the harddisk? (Logic board: yes, or partly; I've done the trick with the MAC address in 10.5 though I'm not sure if all is still needed in 10.7.) – Arjan – 2011-10-04T20:08:34.993

@Arjan Hard disk: From what I've read and personal experience: Can happen. Logic board: Definitely, but you have to change the MAC address, similar to here. Lion: I haven't been on 10.7 yet, so it might be different there?

– slhck – 2011-10-04T20:10:38.697

Thinking about it, maybe this does answer the other question. I figured 92GB was just a part of the harddisk, but maybe it's actually the full disk...? – Arjan – 2011-10-04T20:12:30.400

Could you detail the procedure for OSX 10.7.5 (if different) Thanks ! – Regis_AG – 2012-12-23T00:22:44.260

9

Using tmutil

Disclaimer: I scanned the tmutil manpage and performed these steps. Time machine seems to be backing up happily now. I have no idea if all these steps are necessary, or if I did them in the right order. YMMV.

First disable Time Machine

$ sudo tmutil setdestination /Volumes/TIME_MACHINE_VOLUME
$ sudo tmutil associatedisk -a /Volumes/MACINTOSH_HD/ /Volumes/TIME_MACHINE_VOLUME/Backups.backupdb/COMPUTER_NAME/Latest/MACINTOSH_HD/

This tells Time Machine to backup MACINTOSH_HD the new volume to /Volumes/TIME_MACHINE_VOLUME/Backups.backupdb/COMPUTER_NAME/Latest/MACINTOSH_HD/ which is the old backup repository for the old volume. In my case the old and new volumes both have the same name.

$ sudo tmutil inheritbackup /Volumes/TIME_MACHINE_VOLUME/Backups.backupdb/COMPUTER_NAME/

This connects the old backup repository to the new volume.

Then run:

$ sudo tmutil listbackups

To list the backups, if the above has worked you should see all the backups you had for the old volume.

HughE

Posted 2011-10-04T20:00:23.307

Reputation: 211

Can confirm this still works as of macOS Sierra in 2017. tmutil doesn't seem to like spaces in the name of the backup drive though (even when escaped or quoted), so make sure to rename the mounted sparsebundle volume or drive to a one-word name. – Nick Sweeting – 2017-05-01T03:30:30.590

3

Concerning 10.7+:

Please note that slhck's elaborated answer does NOT apply to 10.7 and above. For 10.7+, see tmutil manpage, sections inheritbackup and associatedisk.

Michael Probst

Posted 2011-10-04T20:00:23.307

Reputation: 31

Can you detail the procedure for Mac OSX 10.7 ? Thanks ! – Regis_AG – 2012-12-22T23:36:05.613

1

In my case above answer helped a lot but I modified it a little.

Before reading this I was trying to use inheritbackup command but though it didn't finish with error the time machine was still not seeing my disk and my sparsebundle as the backup.

What seems was needed first was the setdestination command. and now I'm writing this as my Time Machine backup is being updated!
So in the end I first did:

sudo tmutil associatedisk -a /Volumes/Macintosh\ HD /Volumes/Time\ Capsule/Backups.backupdb/<mymacname>/Latest/Macintosh\ HD/

and then:

sudo tmutil inheritbackup /Volumes/Time\ Capsule/<mymacname>.sparsebundle

Paweł Philipczyk

Posted 2011-10-04T20:00:23.307

Reputation: 11