Hoping one of you brilliant folks can help me out. I’m unable to put anything in the trash can but instead get an alert that I can delete it immediately. I had this issue probably about once a month in Mojave, but I found this terminal command online that fixed my issue:
Unfortunately, in Catalina that command produces the error “Operation not permitted.” I heard Catalina changed terminal command somehow, but I’m not enough of a terminal genius to know how to tweak it to make it work. Help? Either with the regular issue of not being able to put things in trash OR on tweaking that terminal command so I can run it in Catalina?
Never tried the tweak you show but I get the error message about deleting things immediately only when I try to drag or delete something off my Synology server into the trash. So I’d look at the source of the stuff you are deleting and make sure it’s really the system disk.
You posted 5 commands. Which one gave the error? That might help narrow it down.
I suspect @ismh might be on the right track with Full Disk Access for Terminal.
Having this problem repeatedly is extremely unusual. Next time it happens, you should really try to figure out what’s going on rather than using those 5 commands, which is basically the terminal version of a bazooka.
OK, thank you very much–both for the advice and for helping me realize I need to look into the cause of the error and not just bazooka it every time . @ismh was correct that the Terminal error was due to Full Disk Access – I was able to run the commands as normal, and trash starting working again, but I got this error:
I can explain almost everything I’ve read in the last few posts.
Beginning with Catalina macOS was split into two filesystems: ‘Macintosh HD’, which is a read-only filesystem, and ‘Macintosh HD - Data’, which is a read/write filesystem.
Macintosh HD is mounted at / (the root of the filesystem). Macintosh HD - Data is mounted at /System/Volumes/Data. Therefore no user can write anything into /Volumes, thus the “Read-only file system” errors when trying to rm -rf /Volumes/*/.Trashes . This would have worked on Mojave but there is no point in trying this any longer.
“staff” is a group, of which you, “mm”, are a member. You don’t need to change anything here.
Putting a file from an external drive into the trash works differently than it does on your internal drive, because you can’t “move” a file between filesystems, instead you have to copy the file to the destination filesystem and then delete the file from the source filesystem. In fact, it appears that when you drag a file from an external drive into the trash it is simply deleted. Anyway, no need to change anything here.
So the only real mystery is what is happening to your own trash, ~/.Trash.
It appears you ran the “ls” commands I suggested after you ran the “rm” commands. Is that correct?
I don’t have Catalina installed, so I may be talking through my hat. Still…
If you can’t drag files into the Trash in the Finder, the problem is almost certainly with ~/.Trash, not with anything in /Volumes/Macintosh HD/.Trashes.
As @jec0047 said, you need to learn the permissions via ls -ld ~/.Trashbefore you delete and remake it. If you can’t drag files into the Trash, one reason may be that the permissions have been changed from drwx------ to something else—something without that w.
If write permission to ~/.Trash has been removed—for whatever reason—all you need to do is restore write permissions to that directory with chmod u+w ~/.Trash. You don’t need to rm the directory and then mkdir it again. (You don’t show it, but I am assuming you did a mkdir ~/.Trash after those rm -rf commands.)
Even if this is the case, it still leaves unanswered the question of why your Trash permissions are being screwed up. I have no idea.
I’m guessing that some of the problems you’re running into with the last two of your five commands are due to Catalina changing to a read-only filesystem for running the OS itself: https://support.apple.com/en-us/HT210650. But again, that shouldn’t affect ~/.Trash, and I don’t think you need to be running the commands that involve /Volume/*/.Trashes.
My understanding is there is a .Trash folder on each external drive, so when files on an external drive are placed in the trash, they are simply moved to the .Trash folder on the drive. No need to copy, then delete.
Thanks @drdrang, that is super helpful. In particular, running chmod u+w ~/.Trash instead of what I was doing is far simpler. Still doesn’t explain why ~/.Trash is losing permissions every now and then (maybe 1x/month), but an easier fix and should be one that works now in Catalina. If this pops up again, I’ll make sure to run ls -ld ~/.Trash and post results here. Hopefully we can track down the issue.
Not your fault, I should have been more clear. Next time it happens do this in Terminal:
ls -alR@ .Trash > trash.txt
This will generate a file named trash.txt in your home directory. You can open it with TextEdit. If it’s not very big go ahead and post it here, otherwise post the first 10 lines or so and we’ll go from there.
I think it would be better if you don’t fire the bazooka right away. Instead, create a folder on your desktop and put the stuff you can’t put in the trash in the new folder.
Great, thanks for that help! I will try to deal with this first before bazooka-ing things . Unfortunately, with my workflow, I actually delete a lot of files, but I could probably come up with a Keyboard Maestro script to move them to a temporary folder instead. Thanks!