I'm trying to make some .iso files with the install medium for the last versions of macOS (From El Capitán to Catalina), so I can burn them in a USB flash drive.
I have found several guides and scripts on how to do it, and all revolve around the command line making a mounting a virtual drive using
hdiutil, then calling the
createinstallmedia program inside
/Applications/Install macOS [version]/Contents/Resources/. Then you unmount the virtual drive and convert it to .iso with
These are the commands that I run beforehand:
hdiutil create /tmp/virtualdrive.cdr -size 16384m -layout SPUD -fs HFS+J -volname Install hdiutil attach /tmp/virtualdrive.cdr.dmg -noverify -mountpoint /Volumes/virtualdrive
The problem is that when I run
createinstallmedia onto the virtual volume I get an error:
sudo createinstallmedia --volume /Volumes/virtualdrive --nointeraction Erasing disk: 0%... 10%... Error erasing disk error number (22, 0) An error occured erasing the disk.
I have plenty of space on the mac to do it. I have run the creation and attaching of the drive with sudo to avoid ownership mismatch, even declaring the virtual drive size with by 8192m and 8g and 16384m and 16g. I tried
createinstallmedia on a real USB drive and things went flawlessly, so it isn't a problem with my download (I even tried to run it with Mojave an High Sierra, and I still have the same issue)