├── LICENSE ├── README.md └── create_macos_recovery.sh /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 rtrouton 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # create_macos_recovery 2 | Tool for repairing the Recovery volume (APFS) or partition (HFS+) on Macs running macOS 10.13.x or later. 3 | 4 | This script uses a macOS 10.13 and later installer application to repair the Recovery volume (APFS) or partition (HFS+). 5 | 6 | **Pre-requisites** 7 | 8 | 1. This script 9 | 2. An installer from Apple's Mac App Store for one of the following versions of macOS: 10 | 11 | * 10.13.x 12 | * 10.14.x 13 | * 10.15.x 14 | 15 | **Note:** macOS Big Sur (macOS 11.x) made significant changes to the Recovery volume and it is unlikely this script will support any version of macOS past macOS 10.15.x. 16 | 17 | 18 | **Running the script** 19 | 20 | Run the `create_macos_recovery.sh` script with one argument: the path to an "Install macOS.app". 21 | 22 | `/path/to/create_macos_recovery.sh "/path/to/Install macOS [Name].app"` 23 | 24 | 25 | Example usage: 26 | 27 | If you have a macOS Catalina 10.15.x installer available, run this command: 28 | 29 | `sudo /path/to/create_macos_recovery.sh "/Applications/Install macOS Catalina.app"` 30 | 31 | This should replace the existing Recovery volume or partition with a fresh install, using the Recovery installation tools available from the macOS installer app. 32 | 33 | 34 | What the script does: 35 | 36 | 1. Downloads the following installer package from Apple's Software Update service: `SecUpd2020-001HighSierra.RecoveryHDUpdate.pkg` 37 | 38 | 2. Expands `SecUpd2020-001HighSierra.RecoveryHDUpdate.pkg` into a directory in `/private/tmp` in order to get access to the `dm` tool included with this installer package. 39 | 40 | 3. Uses the `dm` tool and the Recovery installation tools available from the macOS installer app to rebuild the Recovery volume or partition. 41 | 42 | 4. Cleans up by removing the downloaded `SecUpd2020-001HighSierra.RecoveryHDUpdate.pkg` and expanded package contents. 43 | 44 | This script has been tested with the following OS installers from the Mac App Store: 45 | 46 | * macOS 10.13.6 47 | * macOS 10.14.6 48 | * macOS 10.15.0 49 | -------------------------------------------------------------------------------- /create_macos_recovery.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script uses a macOS 10.13 and later installer application to repair the Recovery volume (APFS) or partition (HFS+). 4 | # 5 | # Based on the following script: 6 | # https://gist.github.com/jonathantneal/f20e6f3e03d5637f983f8543df70cef5 7 | 8 | 9 | # Provide custom colors in Terminal for status and error messages 10 | 11 | msg_status() { 12 | echo -e "\033[0;32m-- $1\033[0m" 13 | } 14 | msg_error() { 15 | echo -e "\033[0;31m-- $1\033[0m" 16 | } 17 | 18 | # Explanation of how the script works 19 | 20 | usage() { 21 | cat <