Search code examples
macosterminalkernel-extension

How to move IOUSBFamily.kext file in trash back to to System/Library/Extensions using Terminal in recovery mode


Im toying with my Mac. I restarted the system forgeting to return the file, How can i move it back or restore without having to reinstall the OS.


Solution

  • This question is probably more suited for https://apple.stackexchange.com/, but I can't figure out how to suggest to move it there…

    If you have another Mac, the easiest way is most likely to boot the Mac you're trying to fix in Target Disk Mode (hold T when you hear the chime) and connect it to your other Mac via a Firewire or Thunderbolt cable. You should then be able to simply restore the kext from the Trash in Finder as you would normally.

    If you can't do the above for whatever reason, you should be able to move it back using a Terminal window in the Recovery system:

    cd "/Volumes/[your-mac-volume]/Users/[your-user-name]/.Trash/"
    

    [your-mac-volume] is Macintosh HD by default.

    [your-username] is your "short" username.

    ls -l
    

    You should see the IOUSBFamily.kext listed.

    sudo mv IOUSBFamily.kext /Volumes/[your-mac-volume]/System/Library/Extensions/
    sudo touch /Volumes/[your-mac-volume]/System/Library/Extensions/
    

    Then, cleanly reboot the system.