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

oot

macrumors newbie
Original poster
Jul 22, 2023
13
0
Does anyone know how to fix the issue of files on an external drive being deleted immediately instead of being moved to trash? Every time I try to delete a file, I get a pop up saying the file will be deleted immediately if I proceed. The move to trash was working fine a few days before. Now, the .Trashes folder on the drive is missing, I checked using ls -a in terminal.

I can't delete an nonexistent folder, unlike with permissions issues. I tried using mkdir to recreate the .Trashes folder but I get a no such file or directory error. I tried restarted the computer and run first aid in disk utility on the drive. Nothing worked.

It's a APFS drive.

Additional info: first aid in disk utility found some errors and fixed them, so now it says drive status is ok, but .Trashes is still missing. I am using macos ventura 13.6.7.
 
Last edited:
At the root level of the external volume, run “ls -la” and post full output.
 
Screenshot 2024-06-07 at 11.39.34 AM.png

The last three folders are folders that I created for storing some personal stuff. The blacked out directory owners are just my username.
This is at /Volumes/[drive-name]
 
First, please confirm that you have granted Terminal full disk access.

Next, temporarly change the drive name to a plain name: "DRIVE". You can change it back afterwards. Then try this command:
Code:
mkdir  /Volumes/DRIVE/.Trashes
If that works, then the problem was likely the absence of full disk access. If there's an error, please show the complete error.

Judging by the blacked-out owner names, it looks like you have the correct ownership and permissions. There appear to be extended attributes on the drive, as signalled by the "@" on the "." entry. Please use this command:
Code:
ls -leOad@  /Volumes/DRIVE

You can preview what that 'ls' command produces with this:
Code:
ls -leOad@  ~/D*
 
Last edited:
Yes, Terminal has had full disk access the entire time I was troubleshooting.

I renamed the drive to Drive.
Screenshot 2024-06-07 at 1.00.06 PM.png

I also tried with sudo mkdir, but same error. I don't think I mistyped anything. I ran the same command but using /Volume/Drive/.Trash and it worked fine (this didn't fix the delete immediately problem). I tried using mv to rename to .Trashes but that also produced "no such file or directory error".

I'm guessing it's some sort of hardcoded exception. I probably could install a APFS driver on a windows vm and create the .Trashes folder on there. That's the only solution I can think of.

Screenshot 2024-06-07 at 1.06.44 PM.png

The blacked out owner name is just my username.

Reformatting the drive would likely fix the issue but there its hundreds of GB and I don't have a spare drive with sufficient capacity.
 
Ignored ownership is enabled.

I looked around online but could not find a similar problem.
 
I see you added to your OP that you ran Disk First Aid and it fixed some errors, but that hasn't fixed the missing ".Trashes" problem. I suggest running it again, and make sure it comes back with no errors.

It's conceivable that the earlier error-fixing has done something to the APFS structure that is preventing the creation of another ".Trashes" folder. It may not be correctable without a reformat.

If an APFS driver on another OS is a no-cost option, it might be worth doing. On the other hand, it might make things worse.
 
I ran first aid twice after the initial run where it fixed the issues. It reports no issue now.
 
Disk First Aid has shown problems. Even if it says they are fixed, that leaves a question mark over the whole drive. I would be erasing the drive and recovering from backup.
 
Screenshot 2024-06-07 at 8.30.07 PM.png

These messages pop up in Console whenever I try to delete a file. I guess the system is trying to create a .Trashes folder but can't for some reason.
 
Probably Ventura.

At this point, I will probably reformat the volume which will fix the issue.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.