Skip to content

reset_nvram_reboot_macos.sh

Corey Watson edited this page Dec 1, 2025 · 1 revision

reset_nvram_reboot_macos.sh

Schedules an NVRAM reset on the next reboot and immediately reboots the Mac.

Overview

This script schedules an NVRAM reset on the next reboot and immediately reboots the Mac. NVRAM stores system settings like startup disk selection, display resolution, speaker volume, etc.

Purpose

Resets NVRAM (Non-Volatile Random-Access Memory) on Intel-based Macs. NVRAM stores settings that macOS accesses quickly, including:

  • Startup disk selection
  • Display resolution
  • Speaker volume
  • Time zone information
  • Recent kernel panic information

Useful for troubleshooting:

  • Boot issues
  • Display problems
  • Audio issues
  • Startup disk not found errors
  • Time/date problems

NOTE: On Apple Silicon Macs (M1/M2/M3), NVRAM is automatically reset during the update process and this manual reset may not be needed.

Prerequisites

  • Root/sudo access required
  • macOS 10.14 or later
  • Intel-based Mac (Apple Silicon uses different reset method)

Configuration

Required Inputs

No configuration required.

Behavior

  1. Checks for root privileges
  2. Detects Mac architecture (Intel vs Apple Silicon)
  3. Sets NVRAM variable to trigger reset on next boot
  4. Immediately reboots the system

Security Notes

  • No secrets exposed in output
  • Runs with elevated privileges (sudo required)
  • WILL IMMEDIATELY REBOOT THE SYSTEM
  • User data is not affected (only system settings reset)

Exit Codes

  • 0 - Success (reboot initiated)
  • 1 - Failure (permission denied, unsupported architecture)

Example Output

[ INPUT VALIDATION ]
--------------------------------------------------------------
 Running as root          : Yes

[ SYSTEM DETECTION ]
--------------------------------------------------------------
 Architecture             : x86_64
 Mac Model                : MacBookPro15,1

[ CURRENT NVRAM ]
--------------------------------------------------------------
Current NVRAM values (subset):
  SystemAudioVolume=%80
  boot-args=
  csr-active-config=%00%00%00%00

[ OPERATION ]
--------------------------------------------------------------
Setting NVRAM reset flag...
 NVRAM Reset Flag         : Set
 Action                   : Initiating reboot

*** SYSTEM WILL REBOOT NOW ***

[ REBOOTING ]
--------------------------------------------------------------

Version History

  • 1.0.0 (November 2024) - Initial release

Links

Clone this wiki locally