Skip to content

macOS Shell Script to automatically clone the EFI partition from either Carbon Copy Cloner or SuperDuper! when run on a Hackintosh.

License

Notifications You must be signed in to change notification settings

echocrow/EFIClone

 
 

Repository files navigation

EFIClone

EFIClone is a macOS bash shell script for Hackintosh machines that can be integrated with Carbon Copy Cloner or SuperDuper! – the two most popular macOS disk cloning utilities.

CCC and SD! will both automatically create bootable clones on real Macintoshes in a single step. Though modern Macs support EFI booting in order to maintain compatibility with running non-Apple operating system on their hardware, they do NOT need the EFI partition in order to boot macOS. Because of this these disk cloning utilities do not copy the contents of the secondary EFI partition from one drive to another when doing their job.

This is where EFIClone comes in.

Both CCC and SD! have the ability to configure a "post flight" script that will be launched when the main clone job has been completed. They pass details of the source and destination drives that were used in the clone job to these scripts, from which the script is able to figure out the associated EFI partitions to automatically copy the contents of the critical EFI folder from the source drive to the destination drive.

The script provides extensive logging, has a "test" mode that will log its actions during a dry run without modifying any data and sends notifications to the notification center with the results of the run.

When configured in your CCC or SD! clone job, EFIClone will allow you to do a single-step clone from your current hackintosh drive to a truly bootable backup drive with no other steps required.

Disclaimer

We are not responsible for any data loss that might occur on your system as a result of this script. Please use common sense and always have a backup handy when attempting things such as this.

Configuration

Beacuse Carbon Copy Cloner and SuperDuper! don't support additional arguments to be passed to post-flight scripts, user configuration settings must be edited directly in eficlone_postflight_settings.sh. This can be done with a text editor.

  • TEST_SWITCH='Y'

    This is most important setting.

    A value of Y tells the script to do a dry run – no data will be modified. Any other value (preferably N for consistency) allows the script to run in normal mode – it will delete the contents of the destination EFI partition and replace them with the contents of the source EFI partition.

    It is recommended to run the script in test mode at least once before doing a full run.

  • LOG_FILE='/Users/Shared/EFIClone.log'

    This is the path where the log file will be written out.

    There is no need to change this setting except for convenience. It is recommended to leave it at its default value.

Usage

For a more detailed installation guide please reference this excellent writeup of CaseySJ on the TonyMacx86 forums.

To prepare the setup, clone this repository and place it anywhere on your system that is accessible.

The configuration of both utilities is similar, but not identical. See the following sections for each.

Carbon Copy Cloner

  1. Create a Clone task as you normally would, defining the Source and Destination partitions.
  2. Click on the Advanced Settings button, just below the Source partition.
  3. The advanced settings pane will open. If necessary, scroll down until you can see the section labeled AFTER COPYING FILES and click on the folder icon next to Run a Shell Script:
  4. Use the file selector window to select eficlone_ccc.sh from the folder you moved it to after downloading.
  5. After you have selected the script your task should have the script name eficlone_ccc.sh showing next to the Run a Shell Script: line.

If you need to remove the script you can click on the X icon to detach the script from your CCC Task.

SuperDuper!

  1. Choose your Source and Destination partitions in the Copy and to dropdown menus.
  2. Click on the Options... button.
  3. This will display the General options tab. Click on Advanced to show the advanced options pane.
  4. Check the box that says Run shell script after copy completes and click on Choose...
  5. Use the file selector window to select eficlone_superduper.sh from the folder you moved it to after downloading.
  6. After you have selected the script your task should have the script name eficlone_superduper.sh showing next to the Run shell script after copy completes line.

CLI

See CLI's help:

eficlone.sh --help

Common Issues

  • Mounting EFI source partition failed. Exiting.

    Mounting EFI partitions may require higher privileges. When running eficlone.sh directly, try running with sudo eficlone.sh.

About

macOS Shell Script to automatically clone the EFI partition from either Carbon Copy Cloner or SuperDuper! when run on a Hackintosh.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%