The Be Sure Blog

Code Snippets | Problem Solving | Tips & Tricks

The Be Sure Blog banner

Fix: Failed to write .IAPhysicalMedia cookie to disk

posted on 21.12.2023 by Below Surface in "MacOS"

When trying to write a MacOS installer on an usb stick with Open Core Legacy Patcher, I got

OpenCore-Patcher[1478:11241] Starting...Erasing disk: 0%... 10%... 20%... 30%... 100%Failed to write .IAPhysicalMedia cookie to disk. Error Domain=NSCocoaErrorDomain Code=513 UserInfo={NSFilePath=/Volumes/Install macOS Sonoma/.IAPhysicalMedia, NSUserStringVariant=Folder, NSUnderlyingError=0x6000021d2100 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}The bless of the installer disk failed.

To fix this, I gave full disk write access to both, MacOS Terminal and Open Core Legacy Patcher. Then the boot stick creation worked!

Go to:

Settings / Security & Privacy / Full Disk Access

Then enable it for Open Core Legacy Patcher (or any other app) and Terminal:

/Applications/Utilities folder/Terminal

After creating the USB stick, you should reverse these settings (remove full disk access for both apps).

Usage at your own risk.


open core legacy patcher
boot usb
usb stick
cookie error


More posts of this category

Manually remove iOS backups from a mac computer

How to locate and remove iOS backups from a mac


Installing Homebrew on a M2 MacBook Air from 2022

How to fix: zsh: command not found: brew


How to create a shortcut file to run bash commands

Need to connect to a server with SSH frequently? Here is how to do it!


Recovery Mode shortcut for a 2012 MacBook Pro

Use this keyboard shortcut to boot into recovery mode


Can't log in to iCloud with correct password?

A nasty bug on older versions on MacOS - here is the solution