Meteen naar de inhoud

Create an OSx rescue USB using an M1 Mac

The requirement of creating an OSx recovery disk on a device being compatible with that OSx, can be overcome by using the method described here.

Please note a temporary image will be created on the desktop. Make sure you have sufficient disk space. In the end of the tutorial, this temporary directory will be deleted and a MacOSx rescue USB will have been created.
And please always double check any command coming from the internet before u execute them in your terminal.

Successfully tested on a Mac M1: Mac OS High-Sierra and El Capitan.

Download the OS-X dmg from this link :

Open the dmg and copy InstallMacOSX.pkg to the desktop.

Open Applications/Utilities/Terminal, and from the terminal, create a directory (in this example named Installer) and extract the InstallMacOSX.pkg file in this directory:

mkdir ~/Desktop/Installer
pkgutil --expand ~/Desktop/InstallMacOSX.pkg ~/Desktop/Installer

Then enter the InstallMacOSX.pkg newly created package:

cd ~/Desktop/Installer/InstallMacOSX.pkg

Extract the package using tar:

tar -xvf Payload

Move the just created InstallESD.dmg file to the desktop:

mv InstallESD.dmg ~/Desktop

Now format a GUID partition scheme USB disk of sufficient size named KEY (or any name) and execute the following instructions:

hdiutil attach ~/Desktop/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app 
hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o /tmp/Installer 
hdiutil resize -size 8g /tmp/Installer.sparseimage 
hdiutil attach /tmp/Installer.sparseimage -noverify -nobrowse -mountpoint /Volumes/install_build 

rm -r /Volumes/install_build/System/Installation/Packages 
cp -av /Volumes/install_app/Packages /Volumes/install_build/System/Installation/ 
cp -av /Volumes/install_app/BaseSystem.chunklist /Volumes/install_build 
cp -av /Volumes/install_app/BaseSystem.dmg /Volumes/install_build 

hdiutil detach /Volumes/install_app 
hdiutil detach /Volumes/install_build 
hdiutil resize -size `hdiutil resize -limits /tmp/Installer.sparseimage | tail -n 1 | awk '{print $ 1}' `b /tmp/Installer.sparseimage 
hdiutil convert /tmp/Installer.sparseimage -format UDZO -o /tmp/Installer 

mv /tmp/Installer.dmg ~/Desktop

At this point, plug the USB named KEY (or any name, just edit the command below), then:

sudo asr restore --source ~/Desktop/Installer.dmg --target /Volumes/KEY --noprompt --noverify --erase

Test the USB and if it is working, YAY!! Now delete the directories and files of this operation from the desktop.