2

I've done some searching online without luck, hoping that one of you mac virtuosos might know the answer. Is there a command that will reboot a Mac into recovery mode? (I know I can do Command + R but Im looking for a terminal command to do this.)

  • 2
    You will have to read up on the nvram command and how to set the boot-args values with that. I'm not turning this into an answer, because testing it scares me (and I always test my answers, if at all possible). – Kusalananda Aug 22 at 21:05
  • @Kusalananda, thank you for this info.Your comment kind of scares me now though, should i be careful when working with "nvram" command? can it damage the file system? anything else? – as134_user3693277 Aug 22 at 23:02
  • @as134_user3693277 nvram shouldn't damage the file system, but it might render the Mac unbootable. But as long as you don't have a firmware password set, you can reset the nvram by holding Command-Option-P-R as the Mac starts up. If you do have a firmware password set... please turn it off before experimenting. Oh, and the newer Macs with T2 security chips may be weird; I haven't experimented with them yet, so I don't know what might go wrong... If you have one, maybe you should play it safe. – Gordon Davisson Aug 23 at 1:42
  • @GordonDavisson, Got it, thank you, this is very useful info, I greatly appreciate it. – as134_user3693277 Aug 23 at 13:19
2

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 Recovery on the next boot, and then reboots the machine.

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

sudo 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.

  • That worked, sudo nvram recovery-boot-mode=unused and sudo reboot does indeed boot to recovery. I did not run sudo nvram -d recovery-boot-mode to reset nvram, I just simply rebooted the machine and it put me back into the OS. – as134_user3693277 Aug 23 at 17:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .