Quick answer
Run sudo gpt destroy /dev/diskX then sudo gpt create -f /dev/diskX and sudo diskutil partitionDisk /dev/diskX GPT JHFS+ "Macintosh HD" 100% — replacing X with your target disk number. This wipes the drive and gives it a fresh pure GPT table.
Context — what's happening here
The macOS installer checks the partition table type before it lets you proceed. It only accepts a pure GUID Partition Table (GPT) — Apple's required format since Intel Macs. The error appears when the disk has an old MBR (Master Boot Record) or a hybrid MBR (mixing MBR and GPT). This typically happens with:
- USB drives that were previously formatted for Windows or Linux
- External drives shared between macOS and other OSes
- Internal drives that had Boot Camp or Linux installed
- Drives that were dd'ed or cloned from a non-Mac source
The error is macOS's way of saying "I don't trust this partition layout — it's not to spec." And honestly, it's right. A hybrid MBR can confuse the installer and lead to boot failures later. The fix is to nuke the old scheme and start fresh.
Fix steps — the only reliable way
Disk Utility's erase button won't always fix this. If the drive has a hybrid MBR, Disk Utility's erase often just rewrites the GPT part and leaves the MBR layer intact — then you're back to the same error. Terminal is the straight path.
- Identify the disk
Rundiskutil listin Terminal. Find your target disk (e.g.,/dev/disk2). The identifier is important — double-check you're on the right one or you'll wipe the wrong drive. - Unmount everything on it
sudo diskutil unmountDisk /dev/diskX
Thegptcommand requires the disk to be unmounted before it can touch the partition table. - Destroy the old partition table
sudo gpt destroy /dev/diskX
This removes both MBR and GPT structures. The disk becomes raw — no partitions, no scheme. It's scary but necessary. - Create a fresh pure GPT
sudo gpt create -f /dev/diskX
The-fflag forces it even if the disk was already GPT. This writes a clean GPT header and table to the first and last sectors. No MBR remnants. - Partition the disk
sudo diskutil partitionDisk /dev/diskX GPT JHFS+ "Macintosh HD" 100%
This creates a single JHFS+ (HFS+) partition covering the whole drive. If you want APFS (recommended for macOS High Sierra and later), useAPFSinstead ofJHFS+. For example:sudo diskutil partitionDisk /dev/diskX GPT APFS "Macintosh HD" 100%. - Verify the result
diskutil listagain. You should seeGUID_partition_schemeas the partition scheme line. That's your green light.
Now quit Disk Utility and proceed with the installer. It'll accept the drive without complaint.
Alternative fix — if the main one fails
Sometimes gpt destroy returns an error like "resource busy" even after unmounting. This happens when the disk has a kernel-level attachment, like a USB enclosure that macOS insists on managing. Try these in order:
- Eject and reconnect the drive physically, then try the destroy step again.
- Use a different USB port — some Mac models (especially 2016–2019 with USB-C) have quirky controller handling that keeps a drive busy across reboots.
- Boot into Recovery Mode (Cmd+R at startup) and run the same terminal commands there. Recovery Mode loads fewer drivers, so the drive won't be locked.
- Last resort: Use
sudo dd if=/dev/zero of=/dev/diskX bs=512 count=1to zero out the first sector. This destroys the MBR if GPT commands won't cooperate. Then rungpt create -f /dev/diskX.
Prevention — don't let it happen again
If you're preparing a USB installer for macOS, always format the drive using diskutil partitionDisk with GPT scheme — don't use the "Master Boot Record" option in Disk Utility's partition tab. That MBR option is there for compatibility with older Windows installers, but it'll give you this exact error when you try to install macOS on it.
Also, if you clone a macOS installer to a USB using dd or cp, the source drive's partition table comes with it. If that source was hybrid MBR, you're inheriting the problem. Better to create the installer using Apple's official createinstallmedia command — it writes a clean GPT.