Trash – How to Delete Files Required by OS X

librarytrash

Carbon copy cloner made a few copies of my hard drive when it was cloning some stuff for me, and put them in a SafetyNet folder.

It copied my library directory with some stuff in it, I was able to get a lot of the stuff erased with "Empty Trash."

Other items like these, I can't change permissions on them, I can't get them erased, even with third party tools. I can't get them erased with sudo rm commands.

/Users/Henry/.Trash/_CCC SafetyNet/2015-08-05 (August 05) 12-47-55/System/Library/CoreServices/XProtect.bundle/Contents/_CodeSignature/CodeDirectory
/Users/Henry/.Trash/_CCC SafetyNet/2015-08-05 (August 05) 12-47-55/System/Library/CoreServices/XProtect.bundle/Contents/_CodeSignature/CodeRequirements
/Users/Henry/.Trash/_CCC SafetyNet/2015-08-05 (August 05) 12-47-55/System/Library/CoreServices/XProtect.bundle/Contents/_CodeSignature/CodeResources
/Users/Henry/.Trash/_CCC SafetyNet/2015-08-05 (August 05) 12-47-55/System/Library/CoreServices/XProtect.bundle/Contents/_CodeSignature/CodeSignature

Any ideas?


And besides the files being protected, every directory on the way down is protected too. I have about twenty of these.

Best Answer

Assuming El Capitan is installed the files are probably still protected by System Integrity Protection due to their origin (/System/Library/CoreServices/XProtect.bundle...) though they are residing in your user's trash.

So boot to the Recovery HD partition, disable SIP and remove the items:

  1. In the menubar open Utilities->Terminal
  2. Enter csrutil disable
  3. Remove the files and folders:

    rm -fr /Volumes/name_of_main_volume/Users/Henry/.Trash/*
    
  4. Enable SIP again csrutil enable
  5. Reboot to your main volume.