Contribute
Register

<< Solved >> Recover Overwritten EFI folder

Status
Not open for further replies.
Joined
Apr 14, 2014
Messages
56
Motherboard
Gigabyte Z97X-UD7 TH
CPU
i7-4790K
Graphics
GT 740
Mac
  1. MacBook Pro
Mobile Phone
  1. Android
tldr; I borked my EFI partition and need to recover it.

While preparing to update to 10.15.17, I followed the advice to update Clover. Since I was updating with Clover Configurator, I didn't realize that r5123 is a pre-release version and makes significant changes to the process. After updating Clover, I tried to reboot, and was greeted with the "No quirks" error that stopped Clover in its tracks. Following advice at https://www.tonymacx86.com/threads/new-clover-release-v5-1-r5123-big-sur-support.304543/, I copied the entire Quirks section of the sample config.plist into my config.plist.

While this allowed me to boot Clover and Catalina, my USB keyboard instantly died when the boot process began. I read many posts, some of which suggested trying USBInjectALL.kext. I figured it was worth a try, so I copied it onto another (FAT formatted) thumb drive.

I booted to Clover and selected the UEFI Shell tool. I noted the thumb drive was FS1: and my EFI partition was FS7:. For whatever reason, this shell views kexts as directories instead of files. I haven't had much experience with this shell and decided to take it slowly. I copied the kext file (directory) from FS1: to FS7:. So far so good, it was in the root of FS7:.

Now here's where I royally messed everything up. I used "mv USBInjectALL.kext EFI" and then "mv USBInjectALL.kext CLOVER" to move it into the directories. I was going to move it one level at a time, because I find that easier to handle when dealing with long folder trees in the command line.

In case you haven't already guessed, what I was actually doing was overwriting what was inside those directories! After I finished, the EFI had only a "Clover" directory (no BOOT, and it changed from all caps to title case). The Clover directory contained the MacOS directory and Info.plist. In other words, I overwrote my entire working Clover install with the contents of USBInjectAll.kext.

So now of course I can't boot Clover at all because I've ruined the EFI partition. Before I mess things up further, I'm hoping someone can show me the best way to get myself out of this mess. I'm considering copying the BOOT and CLOVER folders from the r5123 release onto a thumb drive, adding any kexts I was using such as Lilu and WhateverGreen. Then I'll either use the UEFI shell or boot my installer USB and manually copy those folders to the existing EFI partition.

FWIW, I don't have the option to boot into OS X from my installer USB, probably because I've been directly upgrading for years and am using a very old USB Installer with an old version of Clover. Is it possible that creating a new Clover USB drive with 5123 will allow me to boot into OS X and then reinstall Clover on the hard drive?

I fully expect one or more "I fastidiously backup before executing any update operation." I will stipulate that you are far superior to me and will strike myself repeatedly with a whip made of old thumb drives. While I'm doing that, can anyone tell me how to best recover from this mess I've created?
 
I decided I couldn't make things any worse, so I did just what I said above, except using r5122 instead of 5123:

1) Downloaded Clover 7z archive from https://github.com/CloverHackyColor/CloverBootloader/releases. Unzipped EFI directory to my working Windows desktop.
2) Downloaded FakeSMC, NullCPUPowerManagement, AppleALC, AppleIntelE1000e, Lilu and Whatevergreen kexts.
3) Copied above kexts into EFI\Clover\kexts\Other
4) Copied EFI folder to spare USB drive
5) With both thumb drives inserted (old installer and new Clover), boot to old installer thumb
6) Choose UEFI Shell64
7) Determine new clover is on FS1: and old ruined EFI is on FS7:
8) Erase EFI directory from FS7:
9) Copied EFI from FS1: to FS7:

After this, I turned off the computer, removed the drives, and re-inserted my bluetooth dongle. The computer booted to Clover 5122, and I was able to start up OS X normally. I had to re-pair the BT mouse and iCloud wants me to sign in again, but otherwise it seems normal.

You'd think I'd be smart enough to go to bed after all that, but I'm updating to 10.15.7 now :)
 
Last edited:
Status
Not open for further replies.
Back
Top