Advertisement
Guest User

Apple silicon recreate System Recovery

a guest
Apr 14th, 2024
748
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.04 KB | Software | 0 0
  1. If you want to manually recreate System Recovery:
  2. 1 Boot into macOS and make a Time Machine backup. Don't skip this step; this saves your bacon in case the rest of this goes wrong.
  3. 2 In macOS, install gdisk. Once you've downloaded the installer package, right-click (or hold down Control as you click) on it in Finder, then choose Open. This bypasses Gatekeeper since the package isn't Apple Developer signed.
  4. 3 Boot into 1TR (hold down power at startup, NOT System Recovery) and disable System Integrity Protection in Terminal - downgrading to Permissive Security: "csrutil disable"
  5. 4 Reboot back into macOS and log in to an admin account.
  6. 5 (Recommended) Open Terminal, choose Help in the top menu bar, then search for the "diskutil" man page. Reference the main section and the section on APFS.
  7. 6 Use "diskutil apfs resizeContainer" in Terminal to increase the size of your startup container, disk0s2 (with Macintosh HD and Macintosh HD - Data inside). Leave exactly 5,368,684,544 bytes of free space for the System Recovery container. (Use the diskutil info command and calculate: disk0 size - (disk0s2 size + offset) == 5,368,684,544)
  8. 7 Create an APFS container for System Recovery using most of the remaining free space - you'll have 20480 bytes leftover: diskutil addPartition disk0 APFS DeleteMe 5368664064
  9. 8 Delete the pre-supplied volume in the new APFS container: diskutil apfs deletevolume DeleteMe
  10. 9 Run "diskutil list" and get the whole disk identifier (diskX) for the new APFS container you made. In your case it will probably be disk3.
  11. 10 Add an APFS volume named "Recovery" with the Recovery role to the new container. Adjust the disk identifier with what you got from the previous step: diskutil apfs addvolume disk3 APFS Recovery -role R
  12. 11 Run "diskutil apfs list" and verify that the new APFS container contains one volume named "Recovery" with the Recovery role (should have that in brackets next to the name).
  13. 12 (This part requires having SIP disabled from step 3): Run gdisk as root and change the partition type code of the new APFS container you made in steps 7-10:
  14. 1 Operate on /dev/disk0
  15. 2 p to print the current partition table
  16. 3 t to change the partition type code. Choose Partition 3 (the one you made earlier).
  17. 4 Use GUID 52637672-7900-11AA-AA11-00306543ECAC or hex code AF0C. Either way, gdisk should recognize that as "Apple APFS Recovery".
  18. 5 p to print the new partition table, the last partition should now have code AF0C.
  19. 6 w to write the new partition table and exit.
  20. 13 Do a DFU revive (not restore) to install System Recovery into the new container and volume you provisioned in steps 7-12. If successful:
  21. 1 The revive will succeed and your Mac will start up from System Recovery after the revive. It looks exactly like regular macOS Recovery.
  22. 2 If you press, release, and immediately press and hold the power button at startup, you'll no longer run into a circled exclamation mark at startup. Instead, Startup Options will appear.
  23. 14 Re-enable System Integrity Protection. In 1TR: "csrutil enable", or in macOS: "sudo bputil -f"
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement