Can't delete or move item from trash using sudo rm in terminal, in superuser account, or even single user mode
At some point in the past I was messing around with the battery menu on my 2012 macbook pro running High Sierra to see if I could it to display the estimated time remaining rather than a percentage. Anywho, I created a copy of the file /System/Library/CoreServices/Menu Extras/Battery.menu which I no longer needed, so I trashed it.
Since then I have been unable to move the item from the trash or delete it.
I have tried:
- deleting normally
- using the force delete option (option + delete)
- trying to drag item out of trash (makes a copy, which is deletable)
- sudo rm -vrf ~/.Trash/Battery.menu (result: Operation not permitted)
- renaming and moving the file with sudo mv ~/.Trash/Battery.menu (result: Operation not permitted)
- running the above commands after su in terminal
- using the root account to try the above
- booting into single user mode, mounting the file system, using above commands. (result: Operation not permitted)
- using setfile to try to set the busy attribute to not busy and to unlock the file (though it is not locked) using setfile -a z ~/.Trash/Battery.menu. Result: ERROR: Unexpected Error. (-5000) on file: /Users/myuser/.Trash/Battery.menu
- repairing permissions, then trying everything again
- booting into recovery, turning off SIP, and trying to delete again.
Any ideas?
Thanks for your help!
I recently had a file I could not delete from Trash. Finally I moved it from the trash back to the desktop, which I have synced to iCloud. Then I was apple to use the Files app on my iphone to delete it.
Another path to pursue: boot to recovery and turn off SIP (until you get the file deleted.)