As a macOS administrator or enthusiast, having a bootable installer on a USB drive can be incredibly useful for troubleshooting, installing the operating system on multiple machines, or even upgrading your own Mac. In this article, we’ll walk you through the process of creating a bootable macOS installer on a USB drive using a .pkg
file.
Prerequisites
- A Mac running macOS High Sierra or later
- A USB drive with at least 16 GB of free space
- The macOS installer
.pkg
file (downloaded from the Mac App Store or obtained from an Apple Support page) - A basic understanding of Terminal commands
Step 1: Prepare the USB Drive
Before we begin, make sure to backup any important data on the USB drive, as it will be erased during the process.
# List all available disk drives
diskutil list
# Identify the USB drive (e.g., /dev/disk2)
Once you’ve identified the USB drive, unmount it using the following command:
# Unmount the USB drive
diskutil unmountDisk /dev/disk2
Step 2: Convert the .pkg File to a .dmg Image
The .pkg
file is not directly usable for creating a bootable installer. We need to convert it to a .dmg
image first.
# Convert the .pkg file to a .dmg image
hdiutil convert -format UDRW -o /path/to/output.dmg /path/to/installer.pkg
Step 3: Create a Bootable Installer on the USB Drive
Now that we have the .dmg
image, we can create a bootable installer on the USB drive.
# Create a bootable installer on the USB drive
sudo hdiutil attach -readwrite -noverify /path/to/output.dmg
sudo asr restore -source /Volumes/installer.dmg -target /Volumes/USB_DRIVE_NAME --eraseinstall --nointeraction
Replace /path/to/output.dmg
with the actual path to the .dmg
image, and USB_DRIVE_NAME
with the actual name of the USB drive.
Step 4: Verify the Bootable Installer
Eject the USB drive and verify that it’s bootable by inserting it into a Mac and restarting while holding the Option key.
# Eject the USB drive
diskutil eject /dev/disk2
Key Points
- Create a bootable installer: Use a
.pkg
file to create a bootable macOS installer on a USB drive. - Convert .pkg to .dmg: Convert the
.pkg
file to a.dmg
image usinghdiutil
. - Use asr restore: Use
asr restore
to create a bootable installer on the USB drive. - Verify bootability: Verify that the USB drive is bootable by inserting it into a Mac and restarting while holding the Option key.
Technical Specifications
- macOS version: High Sierra or later
- USB drive capacity: At least 16 GB of free space
.pkg
file: macOS installer package file
Conclusion
Creating a bootable macOS installer on a USB drive using a .pkg
file is a straightforward process that requires some basic Terminal commands. By following these steps, you can easily create a bootable installer for troubleshooting, installation, or upgrade purposes.
FAQ Section
What is the minimum USB drive capacity required?
+The minimum USB drive capacity required is 16 GB of free space.
Can I use this method for older macOS versions?
+This method is recommended for macOS High Sierra or later. For older versions, the process may vary.
Is it possible to create a bootable installer on an external hard drive?
+Yes, you can create a bootable installer on an external hard drive, but make sure it is formatted as a single partition.