Skip to content

Instantly share code, notes, and snippets.

@chayanforyou
Created September 3, 2025 05:45
Show Gist options
  • Save chayanforyou/29b7ec29536eaf8f832561d79b87c38c to your computer and use it in GitHub Desktop.
Save chayanforyou/29b7ec29536eaf8f832561d79b87c38c to your computer and use it in GitHub Desktop.
Restoring a Hackintosh EFI from Backup Using macOS Installer USB and Terminal

1. Boot into the macOS installer

  • Plug in your Hackintosh USB installer.
  • At the OpenCore/Clover boot picker, choose “Install macOS …” (the installer).
  • Wait until you reach the macOS Utilities screen.

2. Open Terminal

  • In the top menu bar, click Utilities → Terminal.
    (This gives you a terminal even if your system disk can’t boot.)

3. Find your EFI partition

In Terminal, type:

diskutil list
  • This shows all disks and partitions.
  • Look for your macOS drive (usually disk0).
  • The EFI partition is typically disk0s1, 200 MB, formatted as EFI.

4. Mount the EFI partition

Example:

diskutil mount disk0s1

After this, the EFI partition will appear in Finder as EFI.

5. Access your backup EFI

  • Also mount your macOS main partition (APFS or HFS+). Example:
diskutil mount disk0s2
  • Now you can browse to your Desktop/Documents folder where your backup EFI is stored:
    Path will be something like /Volumes/Macintosh HD/Users/YourName/Desktop/EFI.

6. Copy backup EFI to EFI partition

Use Terminal cp -R to copy:

cp -R "/Volumes/Macintosh HD/Users/YourName/Desktop/EFI" /Volumes/EFI/

⚠️ Make sure to delete the broken EFI first if it exists:

rm -rf /Volumes/EFI/EFI

Then copy:

cp -R "/Volumes/Macintosh HD/Users/YourName/Desktop/EFI" /Volumes/EFI/

7. Reboot

reboot

Remove the USB → system should boot from your restored EFI.


📌 Note

If you renamed your macOS volume to masOS, replace Macintosh HD with masOS in all commands.

For example, to copy your EFI backup:

cp -R "/Volumes/masOS/Users/YourName/Desktop/EFI" /Volumes/EFI/

Additional commands

  1. Mount the macOS partition:
diskutil mount disk0s2
  1. Go to your Desktop folder:
cd "/Volumes/masOS/Users/YourUserName/Desktop"
  • Replace YourUserName with your macOS account name.

  • To check usernames:

ls "/Volumes/masOS/Users"
  1. List files/folders on Desktop:
ls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment