Resolved System Integrity Protection migrated files

Discussion in 'OS X El Capitan (10.11)' started by KALLT, Oct 1, 2015.

  1. KALLT, Oct 1, 2015
    Last edited: Oct 4, 2015

    KALLT macrumors 601

    Joined:
    Sep 23, 2008
    #1
    Answer: The archived system files of a previous system are located in /Library/SystemMigration. You can delete the folder (saved me 800 MB), but it may not work if you had a previous beta installation of El Capitan. In this case you need to turn off System Integrity Protection temporarily or delete the folder remotely from Recovery or a previous OS X installation.

    ---

    I know that upon installation, the system installer moves everything in protected locations (e.g. /System, /bin, /sbin/, /usr) that doesn’t belong there to another location. My question is: where?

    I came across two suggestions:
    /Library/PreviousSystems
    /Library/SystemMigration

    I only have the latter folder, so I don’t know for sure. I’m asking this, because I’m doing some housekeeping and would like to remove the stuff I don’t need anymore. Just curious where the files end up. :)
     
  2. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #2
    I found this in the Ars review here.

    So it looks like /Library/SystemMigration is the only place they go. I have that folder and not PreviousSystems here on my El Capitan upgrade install also.

    Are you thinking like me we would be safe to dump that entire folder? I have about 800MB of cruft in there.
     
  3. KALLT, Oct 2, 2015
    Last edited: Oct 2, 2015

    KALLT thread starter macrumors 601

    Joined:
    Sep 23, 2008
    #3
    That clears it up, I read that part in their review before, hence the confusion.

    I am not sure. My QuarantineRoot folder does have a /System, /usr and /private folder all with a few files. However, these files all don’t look familiar and I’m fairly positive that I didn’t install or change them myself. But if Ars Technica is correct, they will be inaccessible to any program anyway, so it shouldn’t really matter, I suppose, if the folder is gone. Strangely though, removing these files requires root access.

    //Edit

    My folder is 800 MB in size as well, wow. Do you have these dyld_shared_cache files?
     
  4. Weaselboy, Oct 2, 2015
    Last edited: Oct 2, 2015

    Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #4
    I poked around in mine and the only thing I recognized that I installed was a libdvdcss library from Handbrake. Everything else looked like old stuff from the OS.

    I just deleted mine and rebooted with no ill effects. I have it cloned off if I need anything back. I just deleted the folder contents and left the SystemMigration folder and that only prompted for an admin password and not root for me.

    Yep.
     
  5. KALLT thread starter macrumors 601

    Joined:
    Sep 23, 2008
    #5
    I was able to move the entire folder to Trash, but there I couldn’t delete it, because ‘in use’. Reboot didn’t solve it. Hmm..
     
  6. pastrychef macrumors 601

    pastrychef

    Joined:
    Sep 15, 2006
    Location:
    New York City, NY
    #6
    I did the same. Thanks for the tip!
     
  7. mannyo1221 macrumors member

    Joined:
    Sep 21, 2011
    Location:
    Blandford, UK.
    #7
    Disable System integrity protection whilst booted in recovery mode,
    Terminal > csrutil disable
    then restart normally and empty the trash.

    Once done restart into Recovery again and enable system integrity protection.
    Terminal > csrutil enable
    Restart and carry on.
     
  8. pastrychef macrumors 601

    pastrychef

    Joined:
    Sep 15, 2006
    Location:
    New York City, NY
    #8
    Huh? What does that have to do with this thread?
     
  9. KALLT thread starter macrumors 601

    Joined:
    Sep 23, 2008
    #9
    Have you been able to empty your Trash when you moved the folder there?
     
  10. pastrychef macrumors 601

    pastrychef

    Joined:
    Sep 15, 2006
    Location:
    New York City, NY
    #10
    Didn't empty yet.

    Edit: Just emptied. No need to turn off SIP.
     
  11. KALLT thread starter macrumors 601

    Joined:
    Sep 23, 2008
    #11
    It’s not working for me, even after a reboot. Still says all are in use.
     
  12. pastrychef macrumors 601

    pastrychef

    Joined:
    Sep 15, 2006
    Location:
    New York City, NY
    #12
    I didn't even reboot. I just double checked that nothing else was in trash that I needed and then pressed empty.
     
  13. pastrychef macrumors 601

    pastrychef

    Joined:
    Sep 15, 2006
    Location:
    New York City, NY
    #13
  14. KALLT thread starter macrumors 601

    Joined:
    Sep 23, 2008
    #14
  15. Wheelie4 macrumors regular

    Wheelie4

    Joined:
    Jun 6, 2007
    Location:
    NC, USA
    #15
    If you are unable to empty the trash with that folder in it and you really want to delete it try "Secure Empty Trash" and see if that works.
     
  16. chrfr macrumors 603

    Joined:
    Jul 11, 2009
    #16
    Try these:
    -boot into safe boot by holding shift and see if the files delete that way.
    -try to delete in Terminal by typing
    Code:
    sudo rm -rf 
    and then drag the folder from the trash to the Terminal window to have the path transferred there. Then press return and enter your password when prompted.
     
  17. KALLT thread starter macrumors 601

    Joined:
    Sep 23, 2008
    #17
    That option is gone in El Capitan.

    Thanks for the suggestion. Is there any way to find out which process is still accessing these files?
     
  18. chrfr macrumors 603

    Joined:
    Jul 11, 2009
    #18
    use
    Code:
    sudo lsof |grep yoursearchtermhere
    On my computer there's a root owned process called UserEventAgent which is using those SystemMigration files.
    They seem like they should be there, so perhaps deleting them is ill-advised.
     
  19. KALLT thread starter macrumors 601

    Joined:
    Sep 23, 2008
    #19
    I tried that yesterday, but it returns nothing. Tried SystemMigration as well as some other files and folders within it.
     
  20. KALLT thread starter macrumors 601

    Joined:
    Sep 23, 2008
    #20
    Attempting to delete a file from the Terminal will return this:
    Code:
    $ cd ~/.Trash/SystemMigration/History/Migration-F1985D55-D0A0-422E-92B6-36A6E48E6CAE/QuarantineRoot/System/Library/LaunchAgents
    $ sudo rm com.apple.AirPortBaseStationAgent.plist
    override rw-r--r--  root/wheel restricted for com.apple.AirPortBaseStationAgent.plist? y
    rm: com.apple.AirPortBaseStationAgent.plist: Operation not permitted
    I haven’t seen this before.
     
  21. chrfr macrumors 603

    Joined:
    Jul 11, 2009
    #21
    Those particular files are indeed SIP protected. You can see this by using
    Code:
    ls -lO
    (that's a capital letter O.)
    SIP protected files show a "restricted" in the output of ls.
     
  22. KALLT thread starter macrumors 601

    Joined:
    Sep 23, 2008
    #22
    Interesting, it seems that every end folder has at least one restricted file. Even the ‘empty’ CoreServices folder has a hidden file with a restricted flag. Maybe SIP is the problem after all.
     
  23. adnbek macrumors 65816

    adnbek

    Joined:
    Oct 22, 2011
    Location:
    Montreal, Quebec
    #23
    Deleting just the Quarantine folder works fine. No need to delete the "SystemMigration" root folder.

    Had no problem emptying trash after. YMMV
     
  24. KALLT thread starter macrumors 601

    Joined:
    Sep 23, 2008
    #24
    Except when it doesn’t. :) When I attempt to do that, all the sub folders of QuarantineRoot are marked as ‘in use’. When I attempt to do it with sudo rm -r then I get the response above.

    I think this might be something related to the beta. I had to install OS X with the installer again when the GM arrived, so naturally it would have moved all unnecessary components out of the way. That would explain why these files are flagged as restricted.
     
  25. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #25
    Just as a data point, I was never on any of the betas.... so you may be onto something there. It does not seem like the rest of us are not having this issue.
     

Share This Page