Apple - Can I initiate a MacOS restart to Recovery mode solely from the command line?

You can do that using the following command:

sudo nvram "recovery-boot-mode=unused"
sudo reboot

This sets a firmware variable in nvram indicating that you want to start in Recovery mode on the next boot, and then reboots the machine.

When done in Recovery mode, run the following from the Terminal in Recovery mode:

nvram -d recovery-boot-mode

This deletes the firmware variable so that the next boot is a normal boot.

If Recovery boot fails and you cannot progress, you could also remove the firmware variable by holding down the keys Command, Option, P, and R during boot. This resets the nvram and thus the firmware variable.


None of the above solutions worked for me in Big Sur. But this one did.

Internet:

sudo usr/sbin/nvram internet-recovery-mode=RecoveryModeNetwork

or Disk:

sudo usr/sbin/nvram internet-recovery-mode=RecoveryModeDisk

when done

sudo /usr/sbin/nvram -d internet-recovery-mode

Tags:

Macos