Unable to Empty Trash and Delete Time Machine Backups? Here’s How to Fix That
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.
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:
- 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:
- 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.
- 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
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/
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.
sudo rm -rf 501/Backups.backupdb/
Enter the administrator password when requested to begin deleting the .Trashes/501/Backup.backupdb/ files
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/*
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.
It worked ! It took about 5 minutes but I am so relieved ! Tha
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!
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!
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)
I tried this first and it worked a treat.
sudo rm -rf /Volumes/BackupDriveName/.Trashes/*
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?
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.
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
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!
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.
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.
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.
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.
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.
This worked great for me!!! Thank you!
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!
It did miracles for me. Worked fine at first try. Thank you!
Alt + Cmd + Del works for me.
This worked! Thank you so much!
Thank you!!!!! I just disconnected the external drive and BAM!! All deleted in nano second. Thanks a million.
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
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
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?
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!
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!
Worked for me as well! Just eject drive!
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.
Good thing I found this before messing with the Terminal!!! Thanks
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.
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!
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.
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.
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.
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
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
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.
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
Did this but get response rm: illegal option — /
usage: rm [-f | -i] [-dPRrvW] file …
unlink file
….
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.
This worked for me. Thank you!!!!
same – does nothing for me.
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