First off, we use the eraseinstall command as a Self Service item which works really well to reinstall Mojave - but we've definitely had a few instances where we're unable to use that method for whatever reason.
I've read that you can boot into IR, then run the startosinstall command from an external USB drive, but I can't seem to get that to work. It just hangs at "Preparing to run macOS Installer...". I'm seeing this when booted into the Catalina recovery partition as this particular device had been upgraded to Catalina.
Disabling Secure Boot/enabling USB boot aren't really options for us, so just trying to figure out the best method. Let me know how you're approaching this fun issue!
I can tell you from my experience that if a device is shipped with an OS (lets say 2.0) then you will be able to reinstall back down to 2.0 even after an upgrade. But if you want to take a device that was shipped with (lets say 3.0) then you will NOT be able to install 2.0. apple prevents this from happening.
Thanks for the comments. And yep, shift, option, command R is the best way IF it originally shipped with Mojave... But we have a number of the original T2 Macs (released July 2018) so they all shipped with High Sierra...
I've opened a case with Apple as there seems to be a bug with startosinstall in the Catalina recovery partition...
I found out about the T2 devices after erasing and rebuilding on an older system, pre-firmware boot laptop that did originally ship with High Sierra. I reached out to Apple support we are fortunate to have enterprise and I received this on how to fix it. For me on 2 MacBook Airs the recovery would not work at all. The laptops would act like they were building and then loop back into recovery. The reason was b/c we erased the firmware when support formated the system with disk utility.
Here is Apple support explanation: "T2-equipped systems like MacBook Air 2018 require Configurator 2 and a 2nd T2-equipped system in order to reinstall the firmware and operating system once the HD has been formatted. This is due to how the T2 chip and secure boot firmware function, and because formatting the HD wipes the firmware that is not just hardware-specific. The firmware on T2 equipped systems is uniquely customized on a per-computer basis. In other words, you need to use Configurator so that we can custom-build and install firmware that will be specific to your system and yours alone - this customized system-specific firmware is what was destroyed when the drive was formatted, and what will need to be replaced in order for you to reinstall the operating system."
Apple sent me this solution and it worked on one and I am running through the other: https://support.apple.com/guide/apple-configurator-2/revive-firmware-in-mac-computers-apdebea5be51/mac
It does not sound like your issuee was like mine but I thought I would share this here.
I have the same query as the OP. Has anyone successfully installed Mojave using a startosinstall command from a Catalina recovery (or Internet Recovery) boot? I'm seeing the same symptoms of it just hanging at "Preparing to run macOS Installer..."
I seem to recall in the past that attempting to 'downgrade' from the recovery boot of one version of macOS (e.g. Mojave) to an earlier version (e.g. High Sierra) wasn't permitted. I'm sure I've seen a response from the startosinstall command alluding to something like that in the past. It just looks like this isn't being well communicated in this particular combination...
Our organisation has yet to receive any devices that shipped with Catalina just yet but it is only a matter of time. In testing I've found it doesn't seem to matter what OS the device shipped with, just that you will need to get into a recovery boot session of the macOS version you want to install (or earlier). Devices that shipped with Mojave and have upgraded to Catalina cannot be wiped and reloaded from the Catalina recovery. IR is an option on these as Mojave 'should' be the IR version presented but obviously this looks like its going to be an issue when we receive a device that shipped with Catalina and the IR is Catalina too.
I found that a recent T2 equipped MacBook Pro we tested could in fact be booted from a Mojave recovery partition on a USB drive by pressing cmd+R after the local drive had been wiped entirely via the disk utility of the Catalina recovery environment. This was even with the startup security settings untouched! This was a surprise as I didn't expect USB storage devices to be scanned by any boot sequence of T2 equipped machines with boot security set at the default level. This did enable us to install and provision Mojave via our usual workflow using the startosinstall command. Your experience may vary of course and even if this does seem to be possible across current devices I would expect this is likely a boot loophole which may well be closed via firmware updates sooner rather than later... hopefully after the new year and after we have been able to accomodate Catalina as a fully supported platform...