How create an El Capitan installation key from Recovery mode without another running Mac.
Start by downloading El Capitan installer from Windows or Linux from this page: https://support.apple.com/fr-fr/HT211683
Copy this installer to an exFat formatted key (go beyond the 4 GB limit and readable under Mac os x) and named DMG for convenience.
Start the Mac in Recovery mode, then through the terminal:
- Create a working partition
List the disk configuration:
diskutil list
- Then locate the internal disk, usually disk0
If the structure is ok, we should find a partition named "Macintosh HD" or other with an index disk0s2
If so, create a 50 GB working partition by subtracting those 50 GB from the size of the original partition:
example on a 250 GB disk this will give 200 GB for the main partition and 50 GB for the installation one:
diskutil resizevolume disk0s2 200g jhfs+ work 0b
This will create the work partition of approximately 50 GB.
Then plug in the key and copy the dmg file to the new partition:
cp /Volumes/DMG/InstallMacOSX.dmg /Volumes/work
It should take a few minutes and if ok, no terminal feedback.
Then go to the working directory:
cd /Volumes/work
and mount the disk image:
hdiutil attach InstallMacOSX.dmg
Some lines of info should follow which should end with: /Volumes/Install OS X
Then recover from the disk image mounted above, the InstallMacOSX.pkg file:
cp -v /Volumes/"Install OS X"/InstallMacOSX.pkg .
Please note that the point at the end of the previous line is important. It designates the current directory (/Volumes/work)
Then un-compact the InstallMacOSX.pkg file in a directory (Installer for example) which will be created by the following pkgutil command:
pkgutil --expand InstallMacOSX.pkg Installer
and position yourself in the created package InstallMacOSX.pkg
cd Installer/InstallMacOSX.pkg
Then un-compact the Payload file using the tar command
tar -xvf Payload
Move the InstallESD.dmg file to the work directory :
mv -v InstallESD.dmg /Volumes/work
Then we can create the installation structure :
8)go to the working directory:
cd /Volumes/work
and clean the installer directory
rm -r Installer/*
Then continue with this :
hdiutil attach InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o Installer/Installer
hdiutil resize -size 8g Installer/Installer.sparseimage
hdiutil attach Installer/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 Installer/Installer.sparseimage | tail -n 1 | awk '{print $ 1}' `b Installer/Installer.sparseimage
hdiutil convert Installer/Installer.sparseimage -format UDZO -o Installer/Installer
First of all create the installation disk partition that we will name CLE by reducing the work partition by 10 GB
diskutil resizevolume /Volumes/work 20g jhfs+ CLE 0b
If ok we then pass the creation command:
asr restore --source Installer/Installer.dmg --target /Volumes/CLE --noprompt --noverify --erase
You can now boot on the EC Installer with the Alt key at boot. The name of the Install partition will be "OS X Base System"
I'v tested this method and it's work fine.
The best way, in the "terminal session" is open a new terminal cmd+n and inside do the command :
/Applications/Safari.app/Contents/MacOS/Safari
Then you connect to the forum (in text mode...) retrieve this post and you can use the copy/paste from the forum tu the initial terminal for each command.
Good luck. ;-
sw_vers