3

I have a Time Machine backup folder on an external drive. I'm done using Time Machine forever, and I just want to access those files in Finder without all the restrictions placed on "backup" files.

Is there a terminal command I can run to give me all permissions to delete, move, etc?

4 Answers 4

1

EDIT: According to @Ken Arnold in the other answer to this question, this technique will not work due to Time Machine backups being locked down by ACLs. I can't guarantee this, as I haven't checked it, but it's worth noting before you proceed with this answer. :ENDEDIT

Based on a quick look at my Time Machine backup, all you should need to do is take ownership of the files.

If you navigate to your Backups.backupdb, you should see a folder with the name of your machine on it. If you cd into that folder, you will find a long list of folders that correspond to every backup Time Machine has made.

Due to the way Time Machine works, each of these folders contains a complete representation of the state of your machine at that particular point in time. To get full permissions to read/write etc, you should simply take ownership of one of the folders.

Suppose you just want the latest backup folder, which OS X has helpfully created a symlink for. In that case, the sequence of commands (with a generic username on my machine) would be:

cd /Volumes/Backup/Backups.backupdb/Lukasa's\ Macbook\ Pro/
sudo chown -R USERNAME Latest

An alternative would be to simply take ownership of the entire backup history, in which case you would use:

cd /Volumes/Backup/Backups.backupdb/
sudo chown -R USERNAME Lukasa's\ Macbook\ Pro

An alternative would be to enable the root account and from there you can mess around with the files to your heart's content. Don't forget to disable root once you're done, and for the love of all that is holy don't ever type rm /.

PLEASE READ:

I haven't tested this on my own Time Machine backup, as it's pretty extensive at this point and I'm quite attached to it. However, it's possible that some issues might occur with the nature of the Time Machine backup. In OS X, Time Machine uses hardlinks to reproduce unchanged files and directories. This means that each file contains the entire filesystem as it was at that point in time. However, OS X does not allow hardlinking to directories outside of Time Machine. I can't honestly say what affect this will have: possibly none, but I can't rule out unexpected behaviour. Just a warning.

1
  • Please delete this answer. It is complete misinformation. The files in the TM backup already have all the correct ownerships and permissions, including all your backed up files belonging correctly to your correct user account. Taking ownership over the entire folder (which actually I think macOS will prevent you from doing, so maybe your answer isn't as dangerous as I thought) will mess up ownerships outside your backed-up user folder, and mess with Library files, MacPort files, etc., that you might also need to restore. Thank you. Commented Oct 14, 2023 at 8:41
6

There's a lot of misinformation out there about Time Machine backups (Lukasa's answer is actually pretty good by comparison); I've identified what I think is actually going on and hope to post some about that soon. But in the mean time, note two things:

  1. Lukasa's answer unfortunately won't work. Time Machine backups are locked down using ACLs. You can clear them, but then you'll have to watch out for the other caveat:

  2. Time Machine hard-links directories. Normally this is something that Thou Shalt Not do, because changes in one directory cause (what look like) changes in some completely separate directory. Time Machine is structured very carefully to keep this from causing problems, but if you go poking around in it yourself, you're on your own.

That said, it should be possible to write a script to replace the hard-linked directories with directories of hard-linked files, which will just take up a bit more space. I may try to make that script someday; upvote the question and this answer if you'd be interested in it. (Or some SU admin tell me the proper way people should be making such requests.)

EDIT 2011-07-26: Hard links on HFS+ are awful awkward beasts. They're actually stored in magical places, and simple things (like moving them around) that would be perfectly fine on, say, ext3 fail inscrutably on HFS+. And it turns out that deleting the last hard link to a file doesn't turn it back into a normal file either. The script I refer to would end up having to look like: copy each file, remove the original. Yuck, but that's effectively what I'm doing with my old Time Machine backup now. I'm still willing to write up what I've learned, if somebody bugs me about it.

2
  • I didn't know that the Time Machine backups were under ACLs. +1 for that, and I'll edit my answer to reflect it.
    – Lukasa
    Commented Jul 13, 2011 at 21:27
  • There's no such thing as hard-linked directories. You can only create hard links on files. And what do you mean by "deleting the last hard link to a file?" Every link to a file is in essence a hard link, so deleting the last one is effectively deleting the file. If you have a file and ln <file> <hardlink> and then rm <hardlink> you're exactly where you started out, with <file> as it were before. Commented Oct 14, 2023 at 8:50
1

Having tackled this a couple of times now I don't think there is a way to "convert" a time machine directory structure to a normal directory structure. However by just copying the directories out the hierarchy permissions should work fine. There are two good ways to do this:

a/ use Finder to navigate to the directory you want and copy it out by dragging and dropping or b/ use terminal to find what you want and pull it out with tmutil restore e.g.

tmutil restore /Volumes/<Drive>/Data/Backups.backupdb/<machine>/2016-10-29-202128/<directory...> /Volumes/<drive>/<restore destination>

This will take a significant amount of time, and requires you to have enough space on the target drive. Its worth copying directories from lower in the drive structure (your user directory for instance) and the Time Machine complete backup contains system files etc you probably don't want in your case.

Do not use the command line cp command as Finder and tmutil will clean up Time Machine-oriented extended attributes for you.

These methods were cribbed from this post and other areas, but credit where its due: https://apple.stackexchange.com/questions/139175/transferring-a-single-folder-from-a-time-machine-to-a-different-mac

0

Just copy the folders containing your info to another place/drive. Erase the Time Machine backup drive with disk utility.

You must log in to answer this question.

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