Removing backups from Apple’s Time Machine

Apple’s Time Capsule is a neat device that provides both wireless access, router functions, and a hard drive for doing automated backups from one or more Macs in the same network.

It’s very easy to use and “just works.” If it runs short on disk space it starts to automatically trim the oldest backups automatically. No intervention needed.

But ease of use often means functionality can suffer, and in one area that this is true with Time Capsule and Time Machine is when it comes time to add another machine to it and there’s not enough space on it to do the first backup.

Which is what happened to me. I purchased a new Mac and wanted to add it to my Time Capsule without reformatting it and removing all my old backups from the two other computers on it.   Pruning it manually is a bit of a bear.  Hence this blog post.

First step is how to manually prune selected backups. To do this, run Time Machine and in the Finder window should be a disk mounted named “Backup of” followed by your computer name. Go to that, open the Backupdb.backup folder, then the folder for your computer. Inside should be a folder for each backup by date, similar to the pic below. Click the cog wheel and select “Remove all backups of” and the generations you want to remove. If you want to remove all backups, do it at the folder above it named after your computer.

Time Machine window

You should be promoted to confirm your password (since this is an obviously dangerous thing to do).

Now this is where it tripped me up. There was no visual confirmation anything was happening. I continued with doing it to a few more. Still no confirmation. I quit Time Machine and then saw a deleting window — which stayed there for hours and hours.

But eventually it finished. Yay!

But guess what, the disk showed no additional free space.  Arrggh….

The answer turns out you need to compress the “sparse bundle” to free up the space. This is where it gets hairy.  To do this requires a command typed into the terminal window.

To help you get the right filename, first do the following. Go into a Finder window (while NOT in Time Machine) and find the disk for your Time Capsule. Mount it, and dive into the folder where it has a large file for each machine you back up ending with .sparsebundle in the filename.

The trick is to enter this filename into the terminal window as an argument to the hdiutil command.  The best way to do this is to first copy the file name into the clipboard as shown below.  DO NOT SELECT COMPRESS IN THE COG MENU. That is not the same thing as what we are trying to do.

Time Machine filename copy

Now go into the Applications folder, find the Utilities folder, then the Terminal application. Run it.  At the prompt carefully type in (but don’t hit return yet):

sudo hdiutil compact

Have at least one space after the word compact, then press CMD-V to paste in the sparsebundle filename. This is what mine looked like:

sudo hdiutil compact /Volumes/Weave's Time Capsule/wowbox_002500a0ece0.sparsebundle

Now press the RETURN key.

You will be prompted for your password. Enter it and it should compact the file and free up the space on your backup disk.

Wow, that was NOT easy, was it? 🙁

Dec 2012 UPDATE: Mountain Lion has a possibly better way of doing this, if the command line doesn’t scare you.  Refer to the best answer in this post about this issue for details.



16 thoughts on “Removing backups from Apple’s Time Machine”

  1. Thanks!

    Exactly what I was looking for, I had absolutely the same issue where I wanted to add a second Mac to my Time Capsule. I got as far as deleting the backups but could not figure out why my disk space was staying the same.

    I actually found that I can use the terminal window the manually “sudo rm -fR *”d the files. I think it is much faster than using the Time Machine/Finder (presumably because it bypasses the trash and just ditches the files in one fell swoop.) However, your way is probably easier.

    Still, after it was all done I was absolutely shocked to find that the disk space was still not given back to me! Your “sudo hdituil” did the trick perfectly, however -Thanks again!

  2. I followed your steps but I keep getting this error “hdiutil: compact failed – internal error”. Any thoughts on what is going wrong? I’m running 10.5.8 on a iMac and 10.6x on two laptops, with a 1tb duel banded Time capsule. Do I need to make sure that Terminal is the only thing running?

  3. Please paste in the command you used that didn’t work. But don’t get your hopes up because I’m not an expert on this utility at all. Alternatively I’d suggest just Googling that error. I *think* you might also be able to mount the sparsebundle within disk utility program and verify it using that. But right now I’m not anywhere I can test that myself.

  4. I found myself with this same problem and was happy to find a solution here.

    HOWEVER, when I open up the Terminal application, and type “sudo hdiutil compact (my .sparsebundle filename), I get no prompt from the appliction for a password.

    After I hit “return” the text advances one line and I get this:


    with a cursor sitting next to it. I’ve tried entering my password at the point, and nothing much happens.

    Any clue on what to do?


  5. Sounds to me like you have a quote in your filename. Note my example above where I have Weave’s Time Capsule. There’s a before the ‘ that is needed to get around that.

  6. For some reason it seems to ages to delete a 500GB file (Well over two hours) Is there anyway of speeding this up?


  7. Hello! This was exactly what I was looking for! Thanks so much.

    I entered the command and got prompted for a password, but then got the following response:

    hdiutil: compact: Only one input file can be specified.

    Any clues? Thanks!

  8. If you have any spaces in your file name (most likely) you have to either escape them (put a in front of each one) or surround the entire name in a single quote. Or just copy and paste the file name as I did above and it should be specified correctly.

  9. Any thoughts on how you delete the backups of a machine you no longer have? I can’t “run Time Machine and in the Finder window should be a disk mounted named ‘Backup of’ followed by your computer name” for a machine that no longer exists, yet I still want to clean out its backups.

  10. thanks for posting this…has saved me a ton of headaches
    one thing you could add to make it even easier is that you can simply type

    sudo hdiutil compact

    then go to your time capsule file (xxx.sparsebundle) and simply drag it into the Terminal window…this will copy the full path and file name in your Terminal..
    less likely to forget a space or an escape character.

    thanks again

  11. Thanks for this, but I cannot find any folders in my Time Machine disk with the word “sparsebundle”. I only have one mac backed up on my TM drive.

    …well there blogs and then there are BLOGS…

  12. @Mark – the article is about Time Capsule, not using Time Machine with an external disk.

    …well there comments and then there are COMMENTS…

  13. Just wanted to drop a note regarding another comment –
    “sudo rm -fR *”
    This is a really quick way to delete everything on your hard drive, it really does work in seconds. So, if you do choose to use it, understand that it’s very risky and if you mess up one of the commands before it, it will wipe your computer.

Leave a Reply

Your email address will not be published. Required fields are marked *