9

I replaced my HD with an SSD (256 GB), and restored the contents from my Time Machine backup (external HD 320 GB).

Now, after a day of working, I plugged in my external HD to make the next backup. Time Machine now started to scan my files, prepared the files etc. (took rather long, because it somehow needed to scan everything), then entered the "Deleting old backups" phase. Everything looked normal, but just when it was about to finish, it failed with "This backup is too large for the backup disk.".

Only about 200 GB of my SSD are used, so this should easily fit on the external 320 GB HD: Not many files have changed since the time I restored the backup.

When I look into the Time Machine drive, I see, that it has automatically deleted all my old versions already I'm really not happy about that! Only the latest one is left - the one I restored from yesterday, and now it seems to create a separate backup for my new disk? Ok, "200 GB x 2 > 320 GB", but that's not what it should do. It should just continue writing the differences, as it has always managed to keep several old versions, so why would it be any different just because I moved the contents to an SSD?

Is there a way to make Time Machine "reconnect" to the new SSD (I assume, it is still somehow "connected" to the old HD, and therefore doesn't treat the changes on my new SSD as changes to the backup?)

I wonder, if I should have rather cloned my HD (e.g. with a third party tool), without Time Machine knowing about it?

2

2 Answers 2

10

From http://simon.heimlicher.com/articles/2012/07/10/time-machine-inherit-backup-using-tmutil

Time Machine uses a unique ID (UUID), which is specific to a volume (i.e. a partition of a disk), to associate the volume with its backup. In OS X releases before 10.7 Lion, when people exchanged their disk or migrated to a different Mac, this feature has made it difficult to get Time Machine to continue adding to the backup history of the previously used disk.

In OS X Lion and now also OS X 10.8 Mountain Lion, there is a nifty new Terminal command called tmutil, which makes this whole drama a breeze.

Here's the command

sudo tmutil associatedisk -a "/Volumes/Macintosh HD" "/Volumes/Time Machine Disk/Backups.backupdb/John Doe's MacBook/Latest/Macintosh HD"

See also How can I use an existing Time Machine backup with my new computer?

3
  • I'm still on 10.6, but good to know how it will work the next time, after I upgrade my OS. Thanks! Commented Dec 25, 2012 at 16:25
  • I actually did it in the past with 10.6, but it involved changing the UUID manually. The value is set as xattr of the backup folder. You should be able to find some tutorial for this. Commented Dec 25, 2012 at 19:04
  • 1
    Be sure to also check out Pascal van Hecke's suggestion to use tmutil inheritbackup. Commented Oct 6, 2016 at 14:32
0

With APFS-based TimeMachine backups, the -a option apparently does not work and just shows a misleading error. I have a TimeMachine backup on an external drive as well as on a NAS (i.e. network drive) within a .sparsebundle image, the latter being suddenly broken (i.e. still same Mac and same backup locations, but the gist of below should still apply to this question). The following assumes knowledge of the command line and what sudo is.

Before going ahead, I made sure the external drive was unmounted and removed from the Mac to not confuse myself and "protect" the functioning backup from inadvertent actions. I rebooted the Mac and performed all steps from an account with administrative privileges and enabled for sudo. Make sure you know the password of your encrypted TimeMachine backup; you may be able to recover it from the macOS keychain application, though.

In my case, the NAS backup broke (could no longer mount the sparse bundle image), which I fixed by switching TimeMachine backups to "manual only" and making sure to stop any ongoing backup processes, then removing only the NAS-backup from the macOS preferences and rolling back the NAS drive/folder containing the sparse bundle file to a (btrfs) snapshot that predated the last successful TimeMachine backup. I knew the system could mount the bundle image for this last backup, hence I did not try a later snapshot, plus the chosen snapshot was luckily just created the night before.

A reboot at this point may not be necessary, but I like a clean slate and this may also help remove any stray mount points. I then re-added the NAS as backup drive in macOS preferences, which detected the existing backup and asked me whether to continue using the "old" backup. I confirmed, but when I browsed the backups through the TimeMachine UI, the old versions did not show up even after waiting quite some time.

I've then re-associated my disk this way:

  1. Manually mount the network drive containing the TimeMachine-backup via Finder (but do not mount the sparse bundle image itself!).
  2. In the Terminal, executed sudo tmutil inheritbackup /Volumes/<shared-network-drive-name>/<my-mac-name>.sparsebundle. This reported to me that a backup of the same name was already associated with my Mac, which confirmed to me that the UI prompt of re-using the "old" backup did in fact work.
  3. Via Finder, mounted the sparse bundle image from the network drive. This may take a while, and prompted me for the backup password. Eventually, Finder opened with the list of available snapshots that I could browse (when browser in Finder, those backups are mounted at /Volumes/.timemachine/<ID>/<date-and-time>.backup).
  4. Internally, the sparse bundle image was mounted at /Volumes/Backups of <my-mac-name> 1/, but the name may be different for you. Note down the path, which I'll call /Volumes/<backup-image>/ below. I checked the contents of this folder via ls /Volumes/<backup-image>/. Interestingly, it did not show all the backups I could browse from Finder (see previous step). Luckily, this wasn't an issue for me in the end, but I don't understand this point. More importantly, I could confirm the most recent backup date-and-time (take note of that for the next step) was matching with what I could see in Finder.
  5. Using the most recent , executed sudo tmutil associatedisk "/Volumes/<name-of-primary-mac-disk>" "/Volumes/<backup-image>/<date-and-time>.previous/<name-of-primary-mac-disk> - Data“. Note that my Mac's primary disk is named "Macintosh HD" and the one on the backup is localized, i.e. it showed "Macintosh HD - Daten" for me, both of which may be entirely different for you. This command did not show any error messages and seemed to do the trick, at least after some time, as confirmed in the following steps. You may need to repeat this for further backups, see note below.
  6. The network connection to my NAS in combination with TimeMachine seems quite flaky, so I had to reboot once or twice again. When I then opened the TimeMachine UI, all the old backups appeared again for browsing any local folder (after some 5-15s to account for network and NAS disk reading latency). I could not select all of the available backup versions as the folder I was browsing was not contained in every backup – when I moved to my Mac's main disk within the TimeMachine UI, however, I could select all backup versions, which confirmed to me that everything was working.
  7. Now it's time to re-set the preferred TimeMachine backup interval and allow it to perform a backup, which will take quite some time as the system has to re-scan and compare all files. Afterwards, re-check that you can browse all previous backups from within TimeMachine UI.

In some cases, you may need to allow TimeMachine to start a backup in step 6 (does not need to complete) before it recognizes the older versions available on the TimeMachine backup.

If just the most recent backup that you actively associated is available, you may need to repeat the step 5 for all the other disks. Below, untested(!) script may help speed up the process:

PRIMARY_MAC_DISK_LOCAL="<name-of-primary-mac-disk>"
PRIMARY_MAC_DISK_BACKUP="<name-of-primary-mac-disk> - Data"
BACKUP_IMAGE="/Volumes/<backup-image>"
for ver in $(ls $BACKUP_IMAGE)
do
  if test -d "$BACKUP_IMAGE/$ver"
  then
    echo sudo tmutil associatedisk "/Volumes/$PRIMARY_MAC_DISK_LOCAL" "$BACKUP_IMAGE/$ver/$PRIMARY_MAC_DISK_BACKUP"
  fi
done

Note that in this case, my mis-match issue mentioned in step 4 may become a problem as those backups will not be associated.

References:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .