Impossible to delete file - Catalina

Hi!


ive got a plug-in file from an old canon camera that found itself in the relocated files folder when installing Catalina.


Everything else in the folder I could delete apart from this .plugin file and the folders above it. Moving it and taking ownership of the folders allowed them to be removed, every trick I can find to remove this file does not work.


Moving to the bin is ok, but on emptying it states “the operation can’t be completed because item ... is in use”. Any variation of “rm” or “Sudo rm”, “rm -r” etc does not remove the file and states that the directory is not empty. Same in the recovery terminal.


First aid finds an issue in normal mode but not when in recovery mode.


Im at my wits end! Any help gratefully received. It’s getting formatted and rebuilt if this doesn’t work!


cheers!



MacBook Pro

Posted on Apr 29, 2020 3:24 PM

Reply
Question marked as Top-ranking reply

Posted on May 5, 2020 11:13 AM

It seems the answers you're getting are just running in circles. When that happens it's time to jump off that merry-go-round and try another carnival ride.


If you're interested in doing that, try deleting the ~/.Trash folder in Single User mode. To do that you will need to mount the filesystem using the same mount -uw /System/Volumes/Data command as before, and at the localhost prompt type the following:


rm -rv /Users/john/.Trash


... using your actual "short user name" instead of mine.


You may or may not get a confirmation asking you if you really want to do that, which is the purpose of the -rv option as well as to satisfy your curiosity whether it is actually deleting anything. Otherwise the usual localhost prompt would reappear, leading one to surmise nothing happened. Typing the single character y (followed by Return of course) is sufficient to confirm.


And in case you were wondering yes I tried it myself. The .Trash folder gets deleted. It's gone. I confirmed its absence in Single User mode. Upon exiting Single User mode and logging in as usual, macOS recreated it on its own, so no manual re-creation was required. Dragging items to the Trash, emptying the Trash, everything worked normally.


Two caveats that I hope I don't have to repeat: (1) back up your Mac which just goes without saying, and (2) bear in mind that I don't have and don't know how to create that "zombie folder" so it's not possible for me to completely duplicate your concern.


Let me know what you think.

18 replies

Apr 29, 2020 4:15 PM in response to Tawb

I understand a Relocated Items folder was created after upgrading macOS. If you see a Relocated Items folder after upgrading macOS says "the PDF document in the Relocated Items folder explains what to do with files placed in this folder" which probably suggested dragging it to the Trash, so doing that was perfectly ok.


The problem is that emptying the Trash doesn't delete it, and you're unable to delete it even with the Terminal commands you tried. In that case determine if you can empty the Trash in "Safe Mode": Use safe mode to isolate issues with your Mac.


If that doesn't work please write back for instructions for deleting it in Single User mode: Start up your Mac in single-user mode - Apple Support.

Apr 30, 2020 8:55 AM in response to Tawb

Hi Tom, if you are interested in using Single User mode, you can probably delete that recalcitrant folder while in that mode.



First please determine the fully qualified pathname of that item (file or folder) in the Trash. You will need to print or write it down carefully, because you can't copy / paste in Single User Mode. 


To do that, select (single-click) the item in the Trash, then hold an option key while selecting the Finder's Edit menu. There will be a menu selection "Copy <the item> as Pathname". The file or folder's fully qualified pathname will be copied to the Clipboard. Paste in somewhere, anywhere, such as in a word processing document like Pages or TextEdit where you can read it, then either print it or write it down because you will need to type it carefully while in Single User Mode.


For example, I dragged an empty folder to the Trash. Its fully qualified pathname happens to be:


/Users/john/.Trash/untitled folder


Spaces and punctuation are important which is the reason you need to write it down or print it.


Then, Start up your Mac in single-user mode. Log in to your account as usual. A cascade of very tiny text will ensue. Wait for it to stop, then press the Return or Enter key until you get a prompt localhost:/ root# that repeats each time you press Return. localhost:/ root# should come back each time. When it does, it's ready for you to type something. The text will be so small you may need a magnifying glass to read it.


  • It's possible these instructions won't work for a variety of reasons. If something unexpected happens in Single User Mode don't panic. You can always exit that mode by typing exit. That would be the most conservative action if you have an "OMG what have I done" moment and want to bail out.
  • Your Time Machine backup is the last line of defense, which everyone ought to have anyway.


At that localhost:/ root# prompt, type the following line exactly as written, ending with the Return key:


mount -uw /System/Volumes/Data


There are exactly two space characters in that line.


  • You should get the localhost:/ root# in response.
  • You may get some lines beginning with "spaceman" or something like it. That's normal. Press Return again and the localhost:/ root# prompt should reappear.
  • The system might rudely interrupt what you're typing as you're typing it because it does things in the background even in Single User Mode. If that happens just press Return and type the line from the beginning.


If you get a response like "read-only file system" or "unknown file system" you might as well bail out at that point. Skip to the end of this reply where you type exit and the system continues to start up. Your system will continue to start normally and will remain unaltered, meaning you're no worse off than you are now.


Assuming you made it this far, you're ready to delete that item. To do that using my above example, you would be typing the following:


rm -rv /Users/john/.Trash/"untitled folder"


  • Notice I had to enclose the fully qualified pathname in quotation marks. That's only necessary because "untitled folder" has a space character in it, but if the item you want to delete doesn't have space characters in its name using quotation marks is optional. It won't hurt to use them.


You should get a response echoing that item's fully qualified pathname, which ought to be familiar to you by now. 


If you do, great! You're done. You will be looking at the localhost:/ root# prompt again. Type exit and the system will continue to start. Examine the Trash and you will no longer find that item in it.


If you got something else, write it down, take a picture, whatever, come back here and report what happened. 


In any event typing exit will allow the system to continue starting up. 

May 1, 2020 7:54 AM in response to Tawb

What I didn't see you do in single-user mode is step inside that reluctant plugin folder and see what is there:


root# cd /Users/rebeccafitzgerald/.Trash/cnbao310.plugin
root# ls -a


And determine if there are hidden files other than current (.) and parent (..) directories in there (e.g. another .DS_Store, other folders, etc.).

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Impossible to delete file - Catalina

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.