30

I've done some searching online without luck, hoping that one of you Mac virtuosos might know the answer. On Intel Macs, I know I can hold Command + R but I'm looking for a terminal command to initiate this without keys being pressed.

Is there a command that will reboot a Mac into recovery mode?

IconDaemon
  • 18,247
  • 10
  • 41
  • 57
as134_user3693277
  • 403
  • 1
  • 4
  • 4
  • I just tried:
    `>sudo nvram internet-recovery-mode=RecoveryModeNetwork`
    `>sudo nvram internet-recovery-mode=RecoveryModeDisk`
    within Big Sur 11.6 on VirtualBox 6.1.28 and none of them worked. Seems that at reboot nvram vars are just ignored and Guest OS skip booting in Recovery Mode.
    – villoez Oct 25 '21 at 14:44

6 Answers6

45

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.

bmike
  • 226,393
  • 78
  • 398
  • 871
jksoegaard
  • 71,929
  • 3
  • 107
  • 181
  • 7
    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 '19 at 17:08
  • This worked for me on an Early 2009 iMac running 10.11! – jtbandes Oct 28 '21 at 15:37
13

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

Internet:

sudo nvram internet-recovery-mode=RecoveryModeNetwork

or Disk:

sudo nvram internet-recovery-mode=RecoveryModeDisk

when done

sudo nvram -d internet-recovery-mode
Niek
  • 103
  • 2
Gavin Greenwalt
  • 239
  • 2
  • 3
  • 1
    It appears BigSur+ versions need this method. – cgseller Jul 29 '21 at 19:28
  • Does this method work for Mojave and Catalina? – lhf Oct 25 '21 at 14:47
  • Worked on macOS 12.0.1 Monterey. Note that you'll need the firmware password if there is one. I didn't have it for my work laptop, but after turning it off, it booted into the login screen normally the next time. – Razzi Abuissa Nov 18 '21 at 17:20
  • I run `sudo nvram internet-recovery-mode=RecoveryModeDisk` and then `sudo reboot` and my system does not reboot in recovery mode. Am I missing something? I'm trying to get a VirtualBox MacOSX Big Sur to reboot in recovery mode. Thanks! – user1847 Nov 21 '21 at 05:02
5

I have tried all provided solutions without success on M1 mac mini (Big Sur 11.0)

Ended up with those two steps:

  • Power off mac
  • Press and Hold Power button until you see Apple logo with options

This is not direct answer but only one worked way to get into recovery that worked for me

sage444
  • 171
  • 1
  • 3
  • This is the only thing that worked for me. I tried Command R, Command shift R, Command Option R, internet recovery, bmike's answer, and jkosegaard's answer. None worked except this – Joshua Wolff Jan 18 '21 at 17:09
3

With Big Sur and the Intel / M1 chip changes, I'm using a tool to manage this for me.

This is open source, so you can look at how it works under the hood for each iteration of the OS and various nvram settings.

Not all invocations work on all OS and hardware: For example, on my Mac Pro 2013 (the shiny black cylinder Mac Pro) the only command that worked for me was

sudo nvram internet-recovery-mode=RecoveryModeDisk
sudo reboot

Now that Big Sur and the Apple Silicon M1-based Macs have shipped - we can retest this on the 2020 hardware.

bmike
  • 226,393
  • 78
  • 398
  • 871
  • Would you happen to know how to choose which macOS Recovery partition to boot to? See [this](https://apple.stackexchange.com/questions/430390/recovery-mode-not-seeing-all-apfs-snapshots) question for more context. – sunknudsen Nov 07 '21 at 11:26
0

That was working fine for me up to High Sierra. From Mojave and beyond I get a slashed circle symbol indicating that's no recovery partition, so I have to manually do Option ⌥ + R + Power.

Edd Growl
  • 2,514
  • 6
  • 20
  • 36
TheUnF
  • 1
  • 1
-3

Here is an app that lets you to boot into anywhere.

https://twocanoes.com/booting-to-macos-recovery-and-diagnostics-mode/

Kazi Upal
  • 3
  • 2