-
-
Notifications
You must be signed in to change notification settings - Fork 89
System Recovery
PurgeWrangler includes various recovery mechanisms detailed in this document.
Quickly recover using an APFS snapshot, available with script version 6.3.0 or newer:
- Boot while pressing ⌘R into recovery mode.
- Log in and choose "Restore From Time Machine".
- Choose the most recent system snapshot to restore and proceed.
Your system can also be recovered manually using the script's backup kexts. Boot while pressing ⌘R into recovery mode. Login as needed, then launch Terminal via the Utilities menu. Before moving forward, you need to know the name of your boot volume. By default, this is usually Macintosh HD. In my case, for example, I have it renamed to macOS, so in my commands, I would enter "macOS".
The following instructions use the default boot disk name: Macintosh HD. On macOS 11, some procedures differ. Note the comments before executing a command. If you are not comfortable executing these commands, please use the fallback mechanism.
# Step 1 - Mount Boot Volume
# For mounting, make sure to use your boot volume name or identifier.
# If you have FileVault enabled:
diskutil apfs unlockVolume "Macintosh HD"
# Type in your password for the account/disk (you won't see it as you type).
# If you don't have FileVault enabled:
diskutil mount "Macintosh HD"
# Step 2 - Recovering Kexts
# Make sure to use your volume name here. Press TAB to autocomplete names in Terminal:
cd /Volumes/Macintosh\ HD
# Overwrite the patched kexts with clean copies:
usr/bin/rsync -a Library/Application\ Support/Purge-Wrangler/Kexts/* System/Library/Extensions/
# If legacy support for AMD GPUs was installed, remove that kext as well:
rm -rf Library/Extensions/AMDLegacySupport.kext
# Fix permissions and rebuild kernel cache:
chmod -R 755 System/Library/Extensions/
chown -R root:wheel System/Library/Extensions/
# Rebuild kernel caches - there are differences between macOS 10 & 11
# If on macOS 11, use kmutil:
kmutil install --update-all --force --volume-root .
# On macOS 10, use kextcache as follows:
kextcache -i .
# Make sure you don't see any errors after kernel cache is rebuilt.
# Step 3 - Snapshot & Rebooting
# On macOS 11, you need to create a new snapshot to reboot into:
/usr/sbin/bless --folder System/Library/CoreServices --bootefi --create-snapshot
reboot
# On macOS 10, all you need to do is reboot:
reboot
This will restore your system to a clean state.
If all recovery mechanisms fail to work:
- Boot while pressing ⌘R into recovery mode.
- Log in and choose "Reinstall macOS".
- Proceed with installation.
No data will be lost and your system will be accessible again.