263

I use a Time Capsule for backup and now I want the drive to back up data from an extra Mac. But the drive is filled up with old backups from Mac 1. There simply is not enough space available for the backup for Mac 2.

I get this error message when running Time Machine backup:

Time Machine could not complete the backup. This backup is too large for the backup disk. The backup requires 28.68 GB but only 626.2 MB are available.

Time Machine needs work space on the backup disk, in addition to the space required to store backups. Open Time Machine preferences to select a larger backup disk or make the backup smaller by excluding files.

I know Time Machine itself is able to remove old backups when it needs more space. But in this case it does not remove any Mac 1 backups to make space for Mac 2.

Question is, how do I do it manually?

4
  • 3
    Given how cheap external drives are, I would be tempted to buy one and use it for your extra machine. I prefer the Elements: amazon.com/Western-Digital-Elements-External-WDBAAU0010HBK-NESN/… Feb 5, 2012 at 11:57
  • 2
    @james.garriss good point :) However, i still have to swap drives in my time capsule:) Feb 5, 2012 at 15:45
  • 3
    Anyone knows if there is a way (without writing a script) to ask TM to only keep 1 backup a month for backup older that 1 year old?
    – gamov
    Sep 27, 2012 at 9:13
  • 2
    Can't you make 2 different partitions on you TM disk and choose a different partition for each mac?
    – Rabskatran
    May 27, 2013 at 9:18

8 Answers 8

269

Be careful with sudo and making sure you pick the correct Mac's files since there is no undo or confirmation of the following command:

sudo tmutil delete /Volumes/drive_name/Backups.backupdb/old_mac_name

The sudo command needs your password (and it won't echo to the screen, so just type it and pause to be sure you're dating the correct files before pressing enter). If you want to be safer, you can pick one snapshot to delete first to be sure the command works as intended. This is nice since it could take hours to clean up some larger backup sets and you want to leave the Mac confident it's deleting the correct information store.

You can use the tmutil tool to delete backups one by one.

sudo tmutil delete /Volumes/drive_name/Backups.backupdb/mac_name/YYYY-MM-DD-hhmmss

Since tmutil was introduced with Lion, this will not work on earlier OS versions.

If you want to get the current directory of backups (there can be multiple destinations defined and only one will be "current")

sudo tmutil machinedirectory

If you back up to a network share, you may have sparse bundle storage and if so, that needs to be compacted as well.

sudo hdiutil compact /Volumes/drive_name/Backups.backupdb/mac_name.sparsebundle
14
  • 6
    Worked like a charm. I had old backups that were huge and disconnected from the original time machine set because of hard drive changes. I couldn't delete them with sudo rm (which is wacky), but this did the trick. Thanks! Aug 29, 2012 at 1:59
  • 7
    @square_eyes That's not how deletion of hard linked files works. Let's say there are 100 intervals with the same file. The file exists on disk once, but the link count is 100. When you delete one, that directory entry goes away where you deleted and the link count is now 99. Only when the link count goes to 0 does the file itself get deleted. All the other deletes just remove a directory entry.
    – bmike
    Apr 13, 2015 at 21:54
  • 7
    There's no need to delete the backups one by one. You can type sudo tmutil delete and then drag all the backups you want to delete into the Terminal window. @drfrogsplat the man page mentions this command can delete backups created by a different machine.
    – pointum
    Oct 12, 2016 at 17:03
  • 8
    As of macOS 10.14.5, the terminal app (e.g., iTerm2) running these tmutil commands require the Full Disk Access privilege. Open System Preferences > Security & Privacy > Privacy > Full Disk Access, and grant the privilege by register the app. (Removing the privilege from the app after the task might be good for the security.)
    – jj1bdx
    Jul 17, 2019 at 1:52
  • 6
    For macOS 11.5.1, a new option -p is required, such as sudo tmutil delete -p /path /to/the/directory.
    – jj1bdx
    Jul 27, 2021 at 7:13
94

The easiest way is to:

  1. Enter time machine (on the Mac whose backup you want to delete)
  2. Go to the point in time you want to delete
  3. Select the icon that looks like a cog in the finder and choose 'Delete Backup' (in Mavericks: Right click in the finder window and choose 'Delete Backup')

This ensures the backup catalog remains accurate and the integrity of your data stays intact.

6
  • 4
    @drfrogsplat is very correct that using the GUI that Apple provides is the best way (works on all versions) to delete a backup and is less prone to error since there are multiple visual feedback (if you look carefully) and a check before you enter your password to be sure you are aware the deletion is permanent.
    – bmike
    Nov 2, 2012 at 3:25
  • 1
    I dont see a delete backup item on mavericks in the cog menu
    – brainray
    Jan 25, 2014 at 12:34
  • @brainray I posted answer for mavericks Feb 2, 2014 at 15:58
  • 1
    Except when it does a partial delete (for whatever reason) it forgets the partial backup is there so you cannot then only delete it with tmutil delete Jan 8, 2017 at 19:40
  • 1
    This doesn't work if you have the "Waiting..." problem. apple.stackexchange.com/questions/207787/… Waiting doesn't always work.
    – Almo
    Nov 21, 2017 at 20:23
47

For Mavericks/Yosemite

  1. Enter time machine
  2. Select the backup
  3. Right click on the backup (on the finder window)
  4. Select 'Delete Backup'

It will ask the password and you are done

enter image description here

8
  • Right click on the backup: where?
    – brainray
    Feb 3, 2014 at 14:50
  • You will be shown a finder window right click in the middle of the window and you will be shown a list of options Feb 3, 2014 at 17:28
  • 19
    It's worth noting that Time Machine will not perform the deletions and not ask for your password until you exit Time Machine. And the procedure to exit Time Machine after selecting files and folders for deletion is also not obvious: you have to click cancel in the lower left hand corner. (Apparently, the thing you are "canceling" is restoration of files; deletions are apparently not considered canceled when you do this.)
    – mhucka
    Jun 20, 2014 at 17:48
  • 3
    This also worked for me from another machine. My old MBP got fried, my new one has different hard drive names and partitions etc. Finally it's filled up up my TM disk, and I don't want to delete all my old machine's backups. So you hold Option, click on time machine in menu bar and "Browse other backup disks". I was able to get to the first old backup by plugging in a drive with the same name. From there I could move to the old drive structure, and use this tip to delete some really old backups.
    – Mark
    Apr 13, 2015 at 21:40
  • Or just click on the root device folder in the sidebar (for the old partition and drive structure to appear). In my case "Devices -> Macbook Pro"
    – Mark
    Apr 14, 2015 at 0:56
23

I've been asking myself this very question, and the answers on here certainly helped. However there's an aspect that's lacking which may be a new implementation "detail" that didn't exist when this question was answered.

tmutil delete does indeed delete backups, but doesn't actually reclaim the space they took, at least not in any guaranteed way. I spent about 2 whole days deleting backups from >2y ago, which according to final completion message amounted to approx. 400Gb of data. I did see the free backup space indication go up correspondingly once, but after the next backup I was down again to only 7% available space (858Gb used instead of around 450Gb). That really had me stymied.

The answer to that mystery is given here: http://blog.hawkimedia.com/2012/08/reclaiming-a-timemachine-volumes-disk-space/ In short, you have to compact the sparse bundle that actually holds the backup if it is hosted on a networked disk, or on a disk that is not formatted in HFS+. I don't have TM backups that are not hosted in a sparse bundle so cannot check if using tmutil delete does reclaim free on those. It might well do and the fact it doesn't on a Time Capsule may simply be a peculiarity of the sparse bundle protocol. The command to execute after sudo tmutil delete is sudo hdiutil compact /Volumes/YourTimeMachineDisk/YourBackupName.sparsebundle . In my case that reported

Starting to compact…
Reclaiming free space…
...................................................................................................................................
Finishing compaction…
Reclaimed 403.2 GB out of 583.5 GB possible.

The good news is that this command took only a fraction of the time tmutil took, spending much less time seeking on the disk and using less RAM (in fact it completed in the time it took me to write this answer).

1
  • I'm deleting backups now without a sparsebundle, and the space does appear to be freed without doing an extra step.
    – Almo
    Nov 21, 2017 at 21:00
23

This script will automatically find the oldest TM backup for your computer, tell you which is the oldest and newest backup and provide you with a prompt to delete the oldest backup. You must enter Y and enter your administrator password to delete it.

bash script:

COMPUTER_NAME=$(scutil --get ComputerName)
NBACKUPS=$(tmutil listbackups | grep "$COMPUTER_NAME" | wc -l)
OLDEST_BACKUP=$(tmutil listbackups | grep "$COMPUTER_NAME" | head -n1)
LATEST_BACKUP=$(tmutil latestbackup)
echo Latest backup: $LATEST_BACKUP

if [[ -n "$LATEST_BACKUP" && "$LATEST_BACKUP" != "$OLDEST_BACKUP" ]]; then
     echo -n "$NBACKUPS backups. Delete oldest: ${OLDEST_BACKUP##*/} [y/N]? "
     read answer
     case $answer in
         y*)
             echo Running: sudo tmutil delete "$OLDEST_BACKUP"
             sudo time tmutil delete "$OLDEST_BACKUP"
             ;;
         *)
             echo No change
             ;;
     esac
 else
     echo "No backup available for deletion"
 fi
2
  • In summary, this script will automatically find the oldest TM backup for your computer, tell you which is the oldest and newest backup and provide you with a prompt to delete the oldest back up. You must enter Y and enter your administrator password in order to delete it.
    – Hengjie
    May 24, 2015 at 8:15
  • 6
    Note this won't automatically reduce the size of your sparsebundle back up files. You'll have to go in and run sudo hdiutil compact /path/to/disk-image
    – Hengjie
    Feb 20, 2016 at 0:40
14

If Time Machine is really only backing up differences, deleting in reverse order is not what you want. Plus given that each delete can take some time, having a script that will delete the next one when the current one completes would be nice.

Following user36971's sample script above, I've written up one that'll delete all backups from the one specified and earlier:

#!/bin/bash

if [ -z "$1" ]
then
    echo "must specify backup id: YYYY-MM-DD-HHMMSS"
    exit 1
fi

FOUND_BACKUP=0;
BACKUPS=""
while read line; do
    if [[ "${line}" == *$1* ]]
    then
        FOUND_BACKUP=1;
    fi

    if [ "${FOUND_BACKUP}" == "1" ]
    then
        BACKUPS+="${line}"$'\n'
    fi
done < <(/usr/bin/tmutil listbackups | tail -r)

if [ "${FOUND_BACKUP}" == "0" ]
then
    exit 1
fi

printf '%s' "$BACKUPS"

echo -n "Delete above backups? [y/N]? "
read answer
case $answer in
    y*)
        while read line; do
            if [ -n "${line}" ]
            then
                echo Running: /usr/bin/sudo /usr/bin/tmutil delete "${line}"
                /usr/bin/sudo time /usr/bin/tmutil delete "${line}"
            fi
        done < <(echo "${BACKUPS}")
        ;;
    *)
        echo No change
        ;;
esac

Do note I did not include the computer name check in my script, so if you're sharing one backup drive with multiple computers, you may need to add an additional check.

4
  • 1
    TM only backups the delta with each run, but keeps a full copy per run on the backup disk. For files not changed between runs (this means most of them), just a new directory entry is added. This could mean that if you only have small deltas between runs, you may have to delete a lot of backups before you notice a significant increase in free space.
    – nohillside
    Sep 9, 2013 at 11:19
  • 3
    The order you delete the backups doesn't make any difference. Indeed, if you use a wildcard with tmutil delete to delete all backups for a given year it will delete them oldest to newest. And btw, using a wildcard is a lot easier than using a script for most cases :)
    – mluisbrown
    Nov 2, 2016 at 10:41
  • I would recommend adding printf '%s' "$BACKUPS" before the delete backups line to give better feedback
    – petr
    Jan 4, 2017 at 10:58
  • 2
    I can delete multiple backups without using while, such as: sudo tmutil delete 2016-06-12-184217 2016-06-19-080529 2016-06-26-092218
    – yuxuan
    Feb 12, 2017 at 16:44
-3

just open up a terminal,

#sudo tmutil disablelocal

this should free up space without deleting TM backups

2
  • 3
    This will disable local Time Machine snapshots from an internal drive - not what the OP is asking about.
    – Scot
    Feb 20, 2013 at 17:45
  • 2
    Yes - this only frees space on the Mac boot volume - not on the destination. Useful, but needs to be on a different question IMO.
    – bmike
    Apr 7, 2013 at 23:18
-3

Here is step-by-step what I did to delete my old backup

  1. Open Time Machine Disk
  2. Locate and open the folder Backups.backupdb
  3. Go to view by date and choose oldest on top
  4. Select the backup you want to delete
  5. Open Teminal and type sudo rm -rvf
  6. Drag and drop the old folders you want to delete in the Terminal Window
  7. Enter you user password at the prompt

Go take a coffee or watch a movie, when the process is done you may have to repeat it again for some folders that don't want to delete.

When all your old folders are gone, Time Machine needs to update its database. Here is a way to force Time Machine to update.

  1. Enter Time Machine and go to the oldest Backup which is still listed
  2. Select it and click on the little gear and then choose Delete Backup
  3. Enter your password and wait a few minutes
  4. Quit Time Machine interface and come back again. Now you should have your Time Machine listing the correct backup.
2

You must log in to answer this question.

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