Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ashleykaryl

macrumors 6502
Original poster
Jul 22, 2011
491
218
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?
 
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.
 
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?
 
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.
 
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
 
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. )
 
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.
 
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.
 
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!
 
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.
Over a year later, this worked for me. So glad to find your post. Spent 3 hours doing everything I knew to do to delete a persistent file in trash. THIS WORKED. Thank you so very much!
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.