- Joined
- Jun 25, 2011
- Messages
- 38
- Motherboard
- Gigabyte GA-Z68MX-UD2H
- CPU
- i5-2500K
- Graphics
- HD 3000
- Mac
- Classic Mac
- Mobile Phone
I'm glad to present the first version of EFIClone - a shell script that, when combined with either Carbon Copy Cloner or SuperDuper!, will allow fully automatic, one-step backups of bootable Hackintosh hard drives. CCC and SD! only copy the visible macOS partition - and leave the EFI partition where the boot loader and customizations untouched.
Fortunately, both products allow the user to set a shell script to run on the completion of the main copy job. That's where this script comes it. Taking input from the backup programs, this script will automatically mount the hidden EFI partitions, copy all data from the source EFI partition to the destination, and then verify that the copy succeeded.
Once the CCC or SD! job with EFIClone completes, you can immediately boot from that new hard drive without having to re-run any CloverConfig, MultiBeast or KExtBeast installations.
Update... I have added a secondary script that can be installed to automatically make a backup archive of good EFI partition contents for you at each successful boot.
The script is included in the beta4 zip file and instructions for installation and use are in post #19 here.
https://www.tonymacx86.com/threads/...-the-efi-partition.246540/page-2#post-1703662
There are a few requirements in order to run this script.
1. Either CCC or SuperDuper!. CCC allows the trial version to run post-copy scripts, so you can use that if you want. (Though I think CCC is definitely worth the price and recommend that you get a license). SuperDuper!, unfortunately, requires that the program be licensed in order to unlock the ability to run a post-install script, but the script has been designed to work with SuperDuper! as well.
2. A hackintosh running macOS 10.9 or later. (Technically, it can run on a real Mac - it just isn't necessary to make a bootable hard drive on a real mac.
3. Because this requires an EFI partition to copy the data to, this does mean that the destination drive where you are copying your boot drive to be a GPT formatted macOS native partition. It should support EFI partitions on drives with both physical partitions and virtual disk partitions. (Both coreStorage and APFS volumes are supported).
4. A little bit of willingness to tinker. Because this is dealing with low-level stuff, I have made the default mode of what I have distributed "passive". In the initial test mode, the script will run and will log what it WOULD do, but it will not actually modify any data. In order to actually get the script to do its thing, you need to edit the script and change the value of one config variable. For now at least, I don't plan to change this default behavior as I want the script to get a lot more use and testing before I am comfortable letting it rip in the wild.
Below are detailed instructions on how to install/configure the script and attach it to either CCC or SD!.
I have set up a GitHub project to track issues and enhancements. If you try it out and want to get assistance or have an enhancement you'd like to see, please consider posting an issue there.
Here is the link to the project on GitHub
https://github.com/wombat94/EFIClone
By all means, please post your experiences here on this thread. I will monitor and help out as best i can.
The latest version of the script will be attached to this first post and will always be available on GitHub as well.
If all of this is TL;DR... here's the shorthand:
1. The script as shipped will not actually modify anything. In order to get it to copy your data on the EFI partition, you MUST edit the script and turn off TEST_MODE. Instructions are in the script.
2. This is release under GPL license. Feel free to use, share, incorporate anything I have here, but please keep the license, copyright and attribution
3. This is release with NO WARRANTY. I would not post it publicly if I didn't think that it was pretty safe, but this is definitely beta software and to do it's thing it has to delete and copy data - this is NEVER risk free. Please be sure to have a safe copy of your data before running this script. I hate to say it this way, because I believe in the value here, but USE THIS AT YOUR OWN RISK.
With that said... the detailed instructions are below and the .zip file attachment has the goods.
I'm glad to be able to share something back to the community. I hope you find it useful.
Wombat94
(please note... I ran out of time this evening tracking down a bug in my validation routine, so I do not have screenshots in the instructions below. Hopefully you can figure it out, but I do plan to come back and enhance this first post in the next few days)
EFIClone
EFIClone.sh is a macOS bash shell script for Hackintosh machines that is designed to integrate with either Carbon Copy Cloner or SuperDuper! - the two most popular macOS disk cloning utilities.
CCC and SD! both will automatically create bootable clones on real Macintoshes in a single step. Though modern Macs support the 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, the disk clone 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.
Both programs pass details of the source and destination drives that were used in the clone job, and from this the script is able to find the associated EFI partitions and automatically copy the contents of the critical EFI folder from the source drive to the destination drive as well.
The script provides extensive logging, has a "test" mode that will log what it WOULD have done but will not modify any data, and sends a notification to the macOS 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.
SCRIPT CONFIGURATION
There are currently only two user confiruation settings.
Since this is a script file, they have to be manually edited with a text editor.
The most important setting is the TEST_SWITCH.
TEST_SWITCH="Y" (Default on a new install is "Y")
The only other setting is the path where the log file will be written out.
LOG_FILE="$PWD/EFIClone.log" (Default is the path to the working directory and a file named EFIClone.log)
There is no absolute need to change this setting, but if you want to force the log to be written elsewhere, you can put the full path in this setting.
From what I can tell, both Carbon Copy Cloner and SuperDuper! run the script with a woking directory of the root of the boot drive "/". That is where it writes the log on my system every time. If you can't find the log, just search for it in SpotLight.
INSTALLATION
There really is nothing to "install". This is a simple shell script that relies ONLY on native macOS command line utilities to perform all of its functions.
Download the file and place it anywhere on your system that is accessible.
CLONE UTILITY CONFIGURATION
The configuration of both utilities is similar, but not exact. See the following sections for each.
Carbon Copy Cloner
Fortunately, both products allow the user to set a shell script to run on the completion of the main copy job. That's where this script comes it. Taking input from the backup programs, this script will automatically mount the hidden EFI partitions, copy all data from the source EFI partition to the destination, and then verify that the copy succeeded.
Once the CCC or SD! job with EFIClone completes, you can immediately boot from that new hard drive without having to re-run any CloverConfig, MultiBeast or KExtBeast installations.
Update... I have added a secondary script that can be installed to automatically make a backup archive of good EFI partition contents for you at each successful boot.
The script is included in the beta4 zip file and instructions for installation and use are in post #19 here.
https://www.tonymacx86.com/threads/...-the-efi-partition.246540/page-2#post-1703662
There are a few requirements in order to run this script.
1. Either CCC or SuperDuper!. CCC allows the trial version to run post-copy scripts, so you can use that if you want. (Though I think CCC is definitely worth the price and recommend that you get a license). SuperDuper!, unfortunately, requires that the program be licensed in order to unlock the ability to run a post-install script, but the script has been designed to work with SuperDuper! as well.
2. A hackintosh running macOS 10.9 or later. (Technically, it can run on a real Mac - it just isn't necessary to make a bootable hard drive on a real mac.
3. Because this requires an EFI partition to copy the data to, this does mean that the destination drive where you are copying your boot drive to be a GPT formatted macOS native partition. It should support EFI partitions on drives with both physical partitions and virtual disk partitions. (Both coreStorage and APFS volumes are supported).
4. A little bit of willingness to tinker. Because this is dealing with low-level stuff, I have made the default mode of what I have distributed "passive". In the initial test mode, the script will run and will log what it WOULD do, but it will not actually modify any data. In order to actually get the script to do its thing, you need to edit the script and change the value of one config variable. For now at least, I don't plan to change this default behavior as I want the script to get a lot more use and testing before I am comfortable letting it rip in the wild.
Below are detailed instructions on how to install/configure the script and attach it to either CCC or SD!.
I have set up a GitHub project to track issues and enhancements. If you try it out and want to get assistance or have an enhancement you'd like to see, please consider posting an issue there.
Here is the link to the project on GitHub
https://github.com/wombat94/EFIClone
By all means, please post your experiences here on this thread. I will monitor and help out as best i can.
The latest version of the script will be attached to this first post and will always be available on GitHub as well.
If all of this is TL;DR... here's the shorthand:
1. The script as shipped will not actually modify anything. In order to get it to copy your data on the EFI partition, you MUST edit the script and turn off TEST_MODE. Instructions are in the script.
2. This is release under GPL license. Feel free to use, share, incorporate anything I have here, but please keep the license, copyright and attribution
3. This is release with NO WARRANTY. I would not post it publicly if I didn't think that it was pretty safe, but this is definitely beta software and to do it's thing it has to delete and copy data - this is NEVER risk free. Please be sure to have a safe copy of your data before running this script. I hate to say it this way, because I believe in the value here, but USE THIS AT YOUR OWN RISK.
With that said... the detailed instructions are below and the .zip file attachment has the goods.
I'm glad to be able to share something back to the community. I hope you find it useful.
Wombat94
(please note... I ran out of time this evening tracking down a bug in my validation routine, so I do not have screenshots in the instructions below. Hopefully you can figure it out, but I do plan to come back and enhance this first post in the next few days)
EFIClone
EFIClone.sh is a macOS bash shell script for Hackintosh machines that is designed to integrate with either Carbon Copy Cloner or SuperDuper! - the two most popular macOS disk cloning utilities.
CCC and SD! both will automatically create bootable clones on real Macintoshes in a single step. Though modern Macs support the 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, the disk clone 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.
Both programs pass details of the source and destination drives that were used in the clone job, and from this the script is able to find the associated EFI partitions and automatically copy the contents of the critical EFI folder from the source drive to the destination drive as well.
The script provides extensive logging, has a "test" mode that will log what it WOULD have done but will not modify any data, and sends a notification to the macOS 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.
SCRIPT CONFIGURATION
There are currently only two user confiruation settings.
Since this is a script file, they have to be manually edited with a text editor.
The most important setting is the TEST_SWITCH.
TEST_SWITCH="Y" (Default on a new install is "Y")
- a value of "Y" tells the script to only test it's run - no modification of data will happen
- a value other than "Y" 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.
The only other setting is the path where the log file will be written out.
LOG_FILE="$PWD/EFIClone.log" (Default is the path to the working directory and a file named EFIClone.log)
There is no absolute need to change this setting, but if you want to force the log to be written elsewhere, you can put the full path in this setting.
From what I can tell, both Carbon Copy Cloner and SuperDuper! run the script with a woking directory of the root of the boot drive "/". That is where it writes the log on my system every time. If you can't find the log, just search for it in SpotLight.
INSTALLATION
There really is nothing to "install". This is a simple shell script that relies ONLY on native macOS command line utilities to perform all of its functions.
Download the file and place it anywhere on your system that is accessible.
CLONE UTILITY CONFIGURATION
The configuration of both utilities is similar, but not exact. See the following sections for each.
Carbon Copy Cloner
- Create a Clone task as you normally would, defining the Source and Destination partitions.
- Click on the Advance Settings button, just below the Source partition.
- 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:"
- Use the file dialog to select EFIClone.sh from the folder where you placed it after downloading.
- After you have selected it, your task should look like this - with the script name "EFIClone.sh" showing next to the "Run a Shell Script:" line. If you want to you can click on the "eye" icon to see a read-only version of the script. If you need to change the script (or remove it completely) you can click on the "X" icon to deatch the script from your CCC Task.
- Choose your Source and Destination partitions in the "Copy" and " to " drop down menus.
- Click on the "Options..." button
- This will display the "General" options tab. Click on "Advanced" to show the Advanced options.
- Check the box that says "Run shell script after copy completes" and click on "Choose..."
- Use the file dialog to select EFIClone.sh from the folder where you placed it after downloading.
- After you have selected it, the dialog should show the path to the script.
Attachments
Last edited: