10

I have moved from a Mac running Snow Leopard to a new Lion machine. Since there was a lot of cruft on the old machine, I set up the new one from scratch, only copying the data over I need. I still want to retain the Time Machine backup of my old machine for a while in case I missed something. That backup spans many months though and is huge. I really just need the latest backup from it, not its whole history.

Is it safe to simply open the Time Machine sparsebundle in Finder or on the CLI and remove the oldest folders? Or should I be using some Time Machine interface or tool to do so? I don't want to do it via the Starfield view, since it'll take me ages to click back and forth and delete each backup individually.

2

4 Answers 4

10

tl;dr - It's safe to delete in whatever way you choose.

The only conceivable problem would be if Time Machine was trying to prune a backup at the same time you were deleting, so maybe turn off Time Machine for the duration of your clean up if you're not using the built in delete button.

enter image description here


You can use tmutil delete in Lion to safely delete backups. The benefit of this is the deletion happens more silently in the background. The downside is the UI isn't speedy for deleting more than one snapshot at a time. In practice, you have to be there to attend multiple deletions.

Don't worry about the internals of how files are linked or stored - yes most of the files in most of the backups are hard links, but to clean these up, you have to delete things folder by folder. The system will handle decrementing the link count so there's no better or worse way to go here.

It is also safe to simply remove them via Finder or any other method - just be patient as each backup contains a full set of directory entries for each file. My (worst) record is 4 days to delete through finder a batch of unwanted backups.

Good advice might be to start small if you can't leave your mac on overnight.

You won't lose any data unless you are deleting the last copy of a version of some file. You don't get any warnings, it will get deleted - this is the same whether you use Time Machine itself, or Finder or rm in some terminal script.


As a brief aside - Why do you want to do this? Time Machine automatically prunes old backups when you're getting low on space. I've found it very comforting to just clone my Time Machine drive to a cheap USB external drive and put it on the shelf. (or make this the drive on the shelf and use it as an excuse to get a new drive) Perhaps it's the perfect pack-rat-keep-everything verses if-you-don't-need-it-now's-the-time-to-delete-it test for Mac users.

5
  • Just to confirm, Lion's tmutil would correctly handle Snow Leopard backups as well? As I said, the old machine doesn't exist anymore, but I want to keep its backup. This backup will not be pruned automatically anymore, because no machine is actively using it anymore. I don't have enough room to backup my new machine though since the old backup is taking up too much room.
    – deceze
    Aug 3, 2011 at 6:44
  • I can't imagine it would handle SL backups incorrectly, but I won't make any guarantees. After reading some more, I'm not sure if it's safe to just delete them from Finder.
    – jtbandes
    Aug 3, 2011 at 6:57
  • 3
    I'm going to edit @jtbandes answer fairly heavily - there is absolutely no wrong way to delete these files. Yes time machine or a shell script using rm may be faster and not tie up your Finder for hours or days, but it's really up to user preference. Whether you delete a hard link or the last copy of a file, any delete does the same thing in the end. The new tmuitl is perfectly fine for deleting any version of Time Machine backups.
    – bmike
    Aug 3, 2011 at 14:17
  • Thanks, bmike — if you're sure it's safe, I'm happy to have that info in my answer :)
    – jtbandes
    Aug 3, 2011 at 15:30
  • "whatever way you choose" does not seem to be true: when not using tmutil then deleting nested directories might affect OTHER backups, due to how hard links work. See How can I delete Time Machine files using the commandline on Super User.
    – Arjan
    Sep 10, 2015 at 6:16
6

Time Machine has supported deleting snapshots from Finder since 10.7:

Like tmutil delete, it only works with the directories for complete snapshots though.

I don't know why it's not allowed normally, but you can delete individual files with something like sudo /System/Library/Extensions/TMSafetyNet.kext/Helpers/bypass rm -rf /Volumes/Time\ Machine/Backups.backupdb/Macintosh/2012-10-04-033043/HD/tmp.

Hard links don't stop working when the original files are removed:

$ echo x > 1; ln 1 2; rm 1; cat 2
x

There's another similar question at Super User.

3
  • .../TMSafetyNet.kext/Helpers/bypass - Very cool, didn't know about this.
    – deceze
    Oct 4, 2012 at 1:16
  • 1
    Be careful using bypass to do this, it will also affect OTHER backups; see How can I delete Time Machine files using the commandline on Super User.
    – Arjan
    Sep 10, 2015 at 6:13
  • The path to the helper has changed on recent OS. /System/Library/Extensions/TMSafetyNet.kext/Contents/Helpers/bypass I'll also reinforce - be careful and don't do this on your only backup destination in case you mess up the syntax or the delete takes more than you wanted. Far better to thin entire intervals in my experience or use the GUI for pruning all instances of one large file/folder.
    – bmike
    Mar 24, 2016 at 16:33
3

You are OK to go ahead and delete the older backups using the Finder. Just beware that any files that only exist in these backup periods will be gone. Deleting backups on command doesn't preserve files or merge/combine backups like the normal Time Machine pruning does in an effort to keep as many files available on the backup as possible.

Time Machine BackUp view through Finder

11
  • I STRONGLY don't advise this method. Due to the nature of incremental backups, slight changes made to the files within the deleted timeframe will cause other change to not be enough to complete the file.
    – Alexander
    Aug 3, 2011 at 8:45
  • FILES THAT HAVE BEEN BACKED UP WITHIN THE DELETED TIMEFRAME WILL BE UNRECOVERABLE WITH TIME MACHINE. i just felt like i should repeat lol
    – Alexander
    Aug 3, 2011 at 8:46
  • 1
    I thought this wasn't true because of the way Time Machine uses hard links. Am I wrong?
    – jtbandes
    Aug 3, 2011 at 9:03
  • 2
    Indeed, I believe @XAleX is wrong, since files are always saved as a whole. The only incremental thing about Time Machine backups is that all unchanged items are hard-linked and are not stored twice. AFAIK.
    – deceze
    Aug 3, 2011 at 9:32
  • So if you don't agree with this method then we would be happy for you to provide a solution to the question above.
    – Slick
    Aug 3, 2011 at 9:33
0

I would recommend against using Finder to delete backups, however it is certainly possible from inside Time Machine itself. When you're in Time Machine, navigate the window to the Computer setting, in the sidebar it should be the name of your computer. When that is the active window, the "Gear" icon on the toolbar changes its functionality. Go "back in time" to the date that you don't want any more and click on the Gear icon. Select "Delete Backup" from the menu and enter your administrator password if prompted and let Time Machine do its thing. This allows Time Machine to update its database and keep the links it makes intact.

2
  • Thanks for your answer, but as I said, this would take me the better part of the day to finish, as it's a terrifically sluggish way to delete more than one backup. And, I believe, the backup is basically deleted normally through the Finder anyway in the end.
    – deceze
    Aug 3, 2011 at 22:42
  • Wow sorry, didn't read the question all the way to the end I guess. Oops
    – bringel
    Aug 4, 2011 at 2:52

You must log in to answer this question.

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