Guide:
Step 1: Prerequisites
Before you start, ensure you have the following:
- A USB flash drive with a capacity of at least 16GB.
- A macOS installer image (downloaded from a trusted source).
- Access to a Debian-based Linux system (e.g., Debian, Ubuntu).
Step 2: Install Dependencies
Open a terminal on your Debian-based Linux system.
Install the required dependencies for creating a macOS installer:
bashsudo apt-get update sudo apt-get install giblib1 libgtk2.0-0 libudev1 libgcrypt20 libusb-1.0-0 libwebkitgtk-3.0-0 wget p7zip-full
Step 3: Format the USB Drive
Insert your USB flash drive into your computer.
Check the device name of your USB drive using the following command:
bashlsblk
Identify your USB drive, usually listed as something like "/dev/sdX" (X being a letter, e.g., /dev/sdb).
Format the USB drive as HFS+:
bashsudo parted /dev/sdX mklabel gpt sudo parted /dev/sdX mkpart primary fat32 1MiB 2MiB sudo parted /dev/sdX set 1 esp on sudo mkfs.fat -F32 /dev/sdX1
Step 4: Mount the macOS Installer Image
Mount the macOS installer image you downloaded:
bashmkdir ~/macOSInstaller sudo mount -o loop /path/to/macos_installer.dmg ~/macOSInstaller
Step 5: Restore macOS to the USB Drive
Use the "dd" command to copy the macOS installer to the USB drive:
Warning: Be absolutely sure to use the correct device name (e.g., /dev/sdX) for your USB drive. Using the wrong device can result in data loss.
bashsudo dd if=~/macOSInstaller/BaseSystem.dmg of=/dev/sdX bs=1M
This process may take some time.
Step 6: Set Up the EFI Partition
Download and install "MountEFI" to mount the EFI partition on the USB drive:
bashwget https://github.com/corpnewt/MountEFI/raw/master/MountEFI.command -O ~/MountEFI.command chmod +x ~/MountEFI.command
Run MountEFI:
bash~/MountEFI.command
Mount the EFI partition of your USB drive.
Step 7: Copy EFI Files
Download the latest Clover EFI bootloader for macOS:
bashwget https://github.com/CloverHackyColor/CloverBootloader/releases/download/5134/CloverISO-5134.tar.lzma -O ~/Clover.tar.lzma
Extract the downloaded file:
bashtar -xf ~/Clover.tar.lzma -C ~/
Copy the EFI files to the EFI partition of your USB drive:
bashcp -r ~/EFI/* /media/$USER/EFI/
Step 8: Unmount EFI Partition
Safely unmount the EFI partition:
bash~/MountEFI.command
Step 9: Eject USB Drive
Eject the USB drive:
bashsudo eject /dev/sdX
Step 10: Install macOS on Mac Mini
Insert the USB drive into your Mac Mini and boot from it.
Follow the on-screen instructions to install macOS on your Mac Mini.x
Creating macOS installer on Debian
I have a mac mini 2012 late and I wanted to try linux on it. Then I've decided to use it with mac os. But I don't have any other mac device.
So can I create bootable macos usb with debian?
Post a Comment