Unable to Empty Trash and Delete Time Machine Backups? Here’s How to Fix That

Aug 12, 2013 - 42 Comments

Empty the Trash when Time Machine backups won't delete

Despite Time Machine being a remarkable solution for easy backups, a peculiar issue can arise for some Time Machine users that causes the Mac OS X Trash to not be able to empty when the backup drive is connected to the Mac. This will usually manifest itself as the following; a user attempts to empty the Trash, the Trash either refuses to empty, or gets stuck on “Preparing to empty the Trash…” which then counts up to several hundred thousand (or more) files. Left alone, the Trash will sometimes start deleting after a few hours of counting the files, but it goes so slow that you can literally wait a day or more for the Trash to delete – hardly practical.

Infinitely counting Trash items when Time Machine backups are deleted

This is obviously a quirk or bug, and it seems to happen either when someone attempts to manually remove backups to create extra space on a hard drive, or when an ancient backup gets corrupted when Time Machine is attempting to perform housekeeping. This issue was was supposedly resolved in a past Mac OS X update, but nonetheless it continues on in Mountain Lion, Mavericks, Sierra, El Capitan, etc, perhaps because the files that are causing the problem are often much older, typically from Mac OS X Lion and before.

OK enough discussion of the problem and some background, let’s get to the solution so that you can empty the Trash can again and remove those old stubborn Time Machine backups once and for all.

Manually Empty Trash when Time Machine Backup Files are Stuck

This requires the use of force delete through the Terminal, which makes it a bit more advanced. If you don’t know what you’re doing or are not comfortable with Terminal you may want to skip this entirely and just wait out the incredibly lengthy Trash deletion through Finder instead. Proceed at your own risk.

Be sure to issue commands precisely otherwise you may unintentionally delete files you do not want to remove, this is very important because the Terminal does not prompt you for approval or confirmation, it simply deletes everything.

  • Connect the Time Machine drive to the Mac and (temporarily) stop any existing Time Machine backups
  • Open Terminal, found within /Applications/Utilities/ and then enter the following command to change the active directory to that of the Time Machine backup drive:
  • cd /Volumes/(backup drive name)/.Trashes/

    For example to change directory to a backup drive named “Mac Backups” the command would be:

    cd /Volumes/Mac\ Backups/.Trashes/

  • Confirm you’re in the proper location by listing the contents of the .Trashes/ folder, this will usually reveal a ‘501’ subfolder, which contains the stubborn Backups.backupdb files. You can double-check you’re in the right place with sudo ls:
  • sudo ls 501/

    Note: Under some circumstances, the 501 folder will not exist, or it will be named something else. Sometimes .Trashes contains the backupdb files directly as well. If you do not find the 501/ directory, just delete the contents of .Trashes/ instead. We’re going to focus on .Trashes/501/ to be as verbose as possible with the intention on reducing errors with rm command.

  • Now to delete the contents of the .Trashes 501 folder using the rm command. Be sure to have the correct syntax in use here otherwise you may accidentally delete something you do not want. The rm command does not ask for confirmation, it simply deletes files.
  • sudo rm -rf 501/Backups.backupdb/

    Enter the administrator password when requested to begin deleting the .Trashes/501/Backup.backupdb/ files

  • Let the Terminal sit and do it’s thing, there is no visible activity but typically that files will be removed within 2-15 minutes at most, exit out of Terminal when finished
  • Confirm Trash is working as intended again by emptying it as usual in the Mac OS X Finder

Advanced users only: shorter syntax version to Trash stuck Time Machine backups

A much shorter version of the above process can be achieved by eliminating some of the safeguards used in the above steps. Only use this command if you are comfortable with the Terminal, replacing “BackupDriveName” with the name of the hard drive in question:

sudo rm -rf /Volumes/BackupDriveName/.Trashes/*

Forcibly delete Time Machine backups from the Trash

Advanced users only: Using tmutil to Delete Stuck Backups by Terminal

Optionally, you can also use the command line ‘tmutil’ tool to delete a backup from Time Machine. Just replace “DRIVENAME” with your Time Machine drive name, and “BACKUPTODELETE” with the backup in question as determined by date. This requires using the Terminal, meaning it’s for advanced Mac users only:

sudo tmutil delete /Volumes/DRIVENAME/Backups.backupdb/BACKUPTODELETE

sudo requires an administrator password to be able to complete the task.

So now we’ve covered several ways to get around this issue, and surely one will work for you.

If the reason you are attempting to delete old backups is to free up space for other media, consider partitioning the backup drive so that a section is devoted to Time Machine while the rest is available for direct file storage. This will prevent the need to manually remove the Time Machine backups in order to make room for files and hopefully prevent this issue from ever arising at all.

Additionally, keep in mind that if you use redundant Time Machine backups you may need to perform this process on both backup drives.

Deleting Time Machine Backups when “System Integrity Protection” Prevents You From Doing So

Another scenario that may occur on newer Macs with newer Mac OS releases is an error when trying to delete Time Machine backups that says something like “Items in the Trash cannot be deleted because of System Integrity Protection”. The workaround for this error is to temporarily disable SIP on the Mac, trash the Time Machine backup files, then re-enable SIP again.

Which method worked for you? Share your own experiences and solutions in the comments below.

.

Related articles:

Posted by: Paul Horowitz in Mac OS, Tips & Tricks, Troubleshooting

42 Comments

» Comments RSS Feed

  1. Charlie says:

    It worked ! It took about 5 minutes but I am so relieved ! Tha

  2. darryl says:

    i have struggled with this for a couple years! Finally found the super easiest solution by accident. I shut down my mac, unplugged it for around 20 minutes. I just let it sit unpowered for a while because I was having other issues and just wanted to drain all the residual power from the whole thing. Plugged it back in and the trash was empty and has stayed that way.
    Hope this helps!

  3. The rm -rf command cleared all but one stubborn directory for me. I had to use the repair function of the Disk Utility app, which fixed my drive – I still couldn’t empty the trash the normal way, but it allowed the rm -rf command to work. Thanks for your help!

  4. Wigglesworth says:

    Deletion took two Phases for me…

    Perform at own risk: There are 2 Phases to this: Usage of TERMINAL and then Usage of TRASH (for quick deletion)

    PHASE I: Usage of TERMINAL:
    Remove each file individually using Terminal

    Step 1: Open: Terminal

    Step 2: cd /Volumes/(backup drive name)/.Trashes/

    Step 3: cd /Volumes/Mac\ Backups/.Trashes/

    Step 3: sudo ls/{space}

    Step 4: drag the file to the Terminal Command in Step 3

    Step 5: Type {User Password}

    Step 6: Reboot

    PHASE II: Usage of TRASH (for quick deletion of final file)

    Remove the last remaining file from within in the Trash, and not through use of Terminal. Permissions are the issue with this file. So, disabling SIP will permit this deletion. Re-enable SIP once complete.

    Step 1: Disable SIP (Boot into Recovery Mode {Hold Down ‘Command + r’ upon boot} > Go to: Utilities Folder > Click: Terminal > and then use this Command: csrutil disable)

    Step 2: Reboot

    Step 3: Log In

    Step 4: Open: Trash

    Step 5: Right-Click: {last file}

    Step 6: Select: Empty Trash

    Step 7: Click: Empty Trash

    Step 8: Close: Trash

    Step 9: Restart

    Step 10: Enable SIP (Boot into Recovery Mode {Hold Down ‘Command + r’ upon boot} > Go to: Utilities Folder > Click: Terminal > and then use this Command: csrutil enable)

  5. Pietro says:

    I tried this first and it worked a treat.

    sudo rm -rf /Volumes/BackupDriveName/.Trashes/*

  6. Nicole says:

    I have an external harddrive with the backup.backupsdb dragged into the trash. They only show when the drive is plugged into the computer.

    In Terminal, on an administrator account, I enter sudo rm -rf /Volumes/My\ Passport\ for\ Mac/.Trashes/ and hit enter.

    Terminal then asks for the password for the drive, which I type in and hit enter. Nothing happens, so I enter:
    sudo rm -rf /Volumes/My\ Passport\ for\ Mac/.Trashes/501/Backups.backupdb

    Still nothing happens. The backups.backupdb file is large and has probably 20 timemachine backups. Do I need to wait and for how long, or is something being done wrong?

  7. Eric says:

    Note to page designer:

    When I put the page into Reader mode, a lot of the content goes away. It’s like part of the story is formatted like extraneous web page garbage. For example, all the steps for manually deleting the backup are gone and it goes straight to the shortcut version.

  8. Lina says:

    Thank you!! The drag&drop trick worked like a charm. I had 454 (!) old backups, and one by one they are now leaving my trash!! Will most def make a partition for TM on my external harddrive

  9. Jim S says:

    Somehow managed to put a Backup In Progress into Trash. No matter what I did, I could not delete it. Spent an hour and a half on the phone with Apple Support (they were very kind and patient) but after they ran through all the tricks in their bag, we still couldn’t get rid of the file…7.24GB package. I was lucky in that I stored my backups on an external drive that contained nothing else but them. The fix was to wipe the external drive clean (which finally emptied the Trash), restart the Mac and perform an immediate backup. What a pain!

  10. RD says:

    Nice job, worked for me to.
    I had over 20 backup folders in the trash and I really didn’t know how to get rid of them.
    Deleted all the 501/ folder, took’t all Night, in the morning when I woke up the trash was empty.

  11. Chuck says:

    Very frustrating. Followed all of the above advice without success.
    Problem solved today. I shut the computer all the way off. I disconnected the external drive from the USB port that contained the Time Machine and restarted the computer, when the screen came to life the trash was empty, I plugged in the external drive into the computers USB port and the trash remained empty. I am relieved. From now on when I want to delete old backups I will do it in the Time Machine Application by entering the Time Machine selecting the earliest file and pushing the delete button at the top of the Time Machine window.

    I hope this experience of mine can help other frustrated users out of the same situation.

  12. P David Welch says:

    This page’s solution DOES work. Read on.

    Out of sheer habit (years), I manually drag and drop my old TM backups to the trash which obviously I have to remember not to do. For years, it did not matter. Once I went to OS 10.12, it mattered. Once in there, I cannot get them back out. I get various error messages if I try.

    Here are things that did NOT work/matter for me

    1-using the alt-cmd-del key combo
    2-right clicking the item in the trash
    3-using alt or control keys and clicking on item in trash
    4-deselecting the backup drive in Time Machine
    5–dragging and dropping TM backups from the trash to the Terminal window (certain commands need to be entered first!)…for me this worked for some, not all. With some I got an override message in the Terminal window

    these are all solutions enthusiastically endorsed by a number of people–NONE solved my problem. Only #5 helped at all but not completely. If they did yours consider yourself lucky !

    What is a little unclear and confusing in this article—which DID solve my problem—

    1–the “sudo ls 501” line….mine turned out to be 502, not 501

    2- on the line sudo rm -rf 501/Backups.backupdb/ it did not work for me because my backups are names 03-31-2017-003898. Once I entered “sudo ls 502/03-31-2017-003898″ (without quotes ” “)…it worked immediately.

    3–this line in the article is written badly “Enter the administrator password when requested to begin deleting the .Trashes/501/Backup.backupdb/ files”. It makes the word “files” look like it is part of the directory command and it also makes you wonder if you are supposed to be re-entering that command…and the command ends with the “…db/”. Files is not part of it. It also makes it sound like you need to do something else but once I entered sudo ls 502/03-31-2017-003898 (and it is LS = ls)……and hit ENTER, the file in the trash disappeared.

    • mbarr says:

      HELP, I have tried all of these suggestions and nothing works!!!!! I have about 10 backups in my trash that I can not get rid of.

      • Joe says:

        This worked great for me! You have to do the first step from the original article, then do the step 2 from his suggestion. For step 2 enter: “sudo ls 502/03-31-2017-003898″ (without quotes and change the numbers to your folders’ names in the trash ” “)… it worked immediately.

    • Joe says:

      This worked great for me!!! Thank you!

  13. Steve Kellar says:

    I had one backup stuck in my Trash for weeks. Tried 4 different ways to delete it, all of them with endless progression bars only to end in failure.

    I found this article tonight, tried it and it worked! Done in 4 minutes.

    Thank you so much for this article!

  14. Eric says:

    It did miracles for me. Worked fine at first try. Thank you!

  15. ZZ says:

    Alt + Cmd + Del works for me.

  16. Justin says:

    This worked! Thank you so much!

  17. Thank you!!!!! I just disconnected the external drive and BAM!! All deleted in nano second. Thanks a million.

  18. Michel Le says:

    this is so convoluted. Someone suggested simply hold down the OPTION key and delete. Voila. All my trap got emptied. No need to go into complicated Terminal programming

  19. Archana says:

    Update: I’m able to enter my password but it still doesn’t do the trick because it shows a message “Archana is not in the sudoers file. This incident will be reported” Please help

  20. Archana says:

    Saw this in a few websites but I can’t get past the last step. When it prompts for the admin password and I input it, it says it’s the wrong password. Thinking that maybe it is wrong, I changed the password, restarted my computer and tried this again. Still says wrong password. Any fix?

  21. CaptainComplexity says:

    Simply eject the drive and connect it to another Mac,if it is ejectable and if you have another Mac, that is. Then trash away!

    • Denise says:

      WOW, read tons and tons of stuff trying to take care of this issue, tried tons and tons of things they said to do to no avail…..and this tiny trick was the fix! As soon as I ejected the drive, boom, they were gone. THANKS!

    • tuqqer says:

      This didn’t work for my situation, but to double check:
      – My external Time Machine hard drive (connected via USB3 to my Mac Pro tower) was full, so I went into it, sorted by date, grabbed some backups from 2 years ago, and put them into the trash. Deleting them didn’t work.
      – I then did as suggested: ejected the TM drive, connected to another Mac (a MBAir). (the trash immediately left the Mac Pro ). Now these TM files immediately showed up in the MBAir. I tried deleting them, and got the same result: 3 hours of spinning wheels and the same eventual error message.

      I’m attempting the Terminal command sequence above, but getting lost at the part where nothing shows up after the cd /Volumes/Time\ Machine/.Trashes/ command. Will continue looking around.

    • AD says:

      Good thing I found this before messing with the Terminal!!! Thanks

  22. AL says:

    For me the folder was named 502.

    Also I had to login as root first, because my user has no sodu rights.

    Let’s say the current user “aUser” has normal rights and “rUser” has root/admin rights then do:

    1. open terminal
    2. su rUser
    3. sudo su
    4. cd /Volumes/(backup drive name)/.Trashes/
    5. ls -la
    (now you will see directories like 501, 502 …)
    6. now delete what you want:
    rm -rf 501/Backups.backupdb/
    or
    rm -rf 502/Backups.backupdb/

    If these are empty (for me the 501 was completely empty) then the rm-command will return immediately without doing anything.

  23. Eran says:

    Boot your computer as “root” user and you’ll be free to do whatever you want without permission limitations on your computer, external hard drives etc.
    Here is how to boot as “root”: http://support.apple.com/en-us/HT204012
    You’ll be wise to:
    1. First backup your computer
    2. As a root user, don’t mess with items if you are not 100% sore you are not damaging anything!

  24. thanks! says:

    This worked with a trick I learned from another website. I had the Terminal open and I had the trash open and could see the folders I wanted to delete from old time machine backups (from machines I don’t use). You can type “rm -rf ” and then drag and drop the folder into the Terminal windows and the path will be copied over. This ensures you are deleting the right folder and you don’t typo the command.

    • Nikita says:

      It’s really working. Easy and very fast, just a second.
      The latest Mac OS. Sierra 10.12.1
      I mean:

      rm -rf (and drag and drop a folder or file from trash to terminal)

      Tank you.

      • Brock MacDonald says:

        Hello,

        I have some time machine files in my trash from a previous OS that were stored on a drive that has since been repurposed. When I do rm -rf (Trashfilesdragged) I get a reply of:
        rm: illegal option — /
        usage: rm [-f | -i] [-dPRrvW] file …
        unlink file
        even under sudo.

        I’ve tried to change permissions in Get Info, but I am still shown I only have reading rights, thought it’s system, staff, all users having read and write privileges.

        It’s only 553 mb, but means I can never empty trash, because these files make an infinite deleting cue, so makes deleting frustrating.

        • cosmin says:

          the reason might be there is a space missing between -rf and the path dragged in!it usually does that if you don’t hit space right after the -rf

        • cosmin says:

          the reason might be there is a space missing between -rf and the path dragged in!it usually does that if the space is missing

      • Ash says:

        Thank you for the tip. It worked brilliantly.
        I was unable to delete the backup files from the trash and was looking for a solution for a long time. rm -rf (and drag and drop a folder or file from trash to terminal) saved me a lot of time.

    • GoodVibes says:

      yay! This was a high lifesaver! Thank you! Make sure to type rm -rf (space) (drag the folder from trash onto the Terminal window) then hit enter

    • noob says:

      Did this but get response rm: illegal option — /
      usage: rm [-f | -i] [-dPRrvW] file …
      unlink file

      ….

      • mm says:

        If you are not familiar with rm and completely fluid in the command line, then do NOT use it, you can easily permanently delete data with zero ability to get it back. It is advanced, not for a ‘noob’.

        Just empty your trash the normal way. Reboot the Mac first if you can’t empty it normally.

  25. Johnny says:

    This worked for me. Thank you!!!!

  26. Dave says:

    same – does nothing for me.

  27. gary says:

    doesn’t work for me.

    sudo rm -rf …. issue the command and it just comes straight back to the prompt having done nothing.

    I can ls the directory and see the backups I want to delete but rm does not work

Leave a Reply

 

Shop on Amazon.com and help support OSXDaily!

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Tips & Tricks

News

iPhone / iPad

Mac

Troubleshooting

Shop on Amazon to help support this site