Become a MacRumors Supporter for $25/year with no ads, private forums, and more!

Cannot delete item in trash

ashleykaryl

macrumors 6502
Original poster
Jul 22, 2011
330
115
UK
I did a clean install of Mojave about a week ago, then a few days later I had a strange experience where the preferences in Mail were blank. I found an explanation to fix this online that involved renaming the container file for Mail inside the user library and restarted the Mac computer, which duly fixed the issue by generating a new one.

I moved the old folder and contents to the trash, but following various restarts, terminal scripts and using Tashit that folder containing Data > DataVaults will not empty from the trash, because it is apparently in use. This means I have to deal with the message explaining why it cannot be deleted every time I empty the trash of other items.

The items are not locked and I am struggling to understand what is happening here. Any ideas?
 

ashleykaryl

macrumors 6502
Original poster
Jul 22, 2011
330
115
UK
You can try to download Onyx as it used to have a function to empty the trash with problematic contents like this....

https://www.titanium-software.fr/en/onyx.html

Thank you, I gave it a try but with the same result. I have simply taken to leaving that folder in the documents folder and labelled it Mystery Mail Data Cannot Delete. It's basically zero bytes but will not delete.
 
Comment

stayupforever909

macrumors newbie
Apr 21, 2019
16
2
Stockholm
Can you try

Code:
sudo su -
Enter password
Code:
cd /Volumes/your-Mac-HD/Users/your-user/Documents/
Code:
ls -la
Who is the directory owned by?
What are the permissions on the directory?
 
Comment

DrBrush

macrumors member
Apr 27, 2016
64
63
I had a similar problem recently with a folder I could not delete. My only solution was to boot my computer using my external CCC backup, mount the internal drive of my MBP, use the Terminal to delete the file and then reboot. Even then, the terminal commands were giving me error messages and saying the file could not be deleted, but when I rebooted on the internal drive it was gone.
 
Comment

GS Owner

macrumors member
Apr 30, 2009
62
0
Harrisburg, PA
Trash It! didn't work.
OnyX didn't work.
Kept getting this and Other messages that they are in use.
If they're in the Trash, how can they be in use?
Spindump.png
 
Comment

DeltaMac

macrumors G4
Jul 30, 2003
10,825
2,972
Delaware
I've had that happen occasionally. The various normal methods just don't do the job.
What often works is to go inside the folder, and trash individual items inside that folder, one at a time.
You will probably find that only one internal folder (or even a single file) is the culprit.

Another fix would be to boot to another drive, navigate to the folder where you keep that stubborn folder, drag that folder to the trash, and empty the trash, while you are still booted to that other drive. (It's a good reason to have another drive available that can boot your Mac. )
 
Comment

Charles Butcher

macrumors newbie
Sep 13, 2012
14
15
Norfolk, UK
These DataVaults are a relatively new feature of macOS and unwanted copies of them are impossible to delete without temporarily disabling System Integrity Protection (SIP).

In short, reboot into recovery mode (⌘-R as soon as you hear the startup chime), use the menu to open Terminal, type "csrutil disable" + return, and then reboot. Now empty the trash. Finally, re-enable SIP by booting back into recovery mode and using the command "csrutil enable". Reboot and you are good to go.

This happened to me when I had to force a reset of Mail.app, and the steps above worked fine. From what I've read, DataVaults are super-secure and there's no way you can delete them via the ordinary methods, which I assume are all based on the sudo command. Sudo is powerful, but not powerful enough in this case.
 
  • Like
Reactions: Alex Sanders74
Comment

webbga

macrumors member
Feb 22, 2014
99
73
Cincinnati, Ohio
I have encountered the Trash problem several times. In each case it involved something that still existed on Time Machine. I realize this is not a solution for everyone, but once a year, I make a good backup to a separate external drive and the nI wipe my Time Machine Drive and start over with a clean backup. Each time I have done this it has resolved the Trash issue.
 
Comment

bombarde32f

macrumors newbie
Jan 4, 2021
1
0
These DataVaults are a relatively new feature of macOS and unwanted copies of them are impossible to delete without temporarily disabling System Integrity Protection (SIP).

In short, reboot into recovery mode (⌘-R as soon as you hear the startup chime), use the menu to open Terminal, type "csrutil disable" + return, and then reboot. Now empty the trash. Finally, re-enable SIP by booting back into recovery mode and using the command "csrutil enable". Reboot and you are good to go.

This happened to me when I had to force a reset of Mail.app, and the steps above worked fine. From what I've read, DataVaults are super-secure and there's no way you can delete them via the ordinary methods, which I assume are all based on the sudo command. Sudo is powerful, but not powerful enough in this case.
Thank you so much for this fix! It worked for me!
 
Comment
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.