How to find out whether NVRAM was reset?

I was having some issues with my mac so I reset NVRAM by holding ++P+R.

The problem is that this laptop does not chime when NVRAM is reset, so I'm not sure if NVRAM was indeed reset.

How can I find out whether NVRAM was reset?

Is there some terminal command that shows when NVRAM was last reset?

  • Laptop: 2017 MacBook Pro
  • OS:MacOS High Sierra

Solution 1:

The no fuss way

The simplest way to know for sure that NVRAM was cleared would be to use Terminal to run:

sudo nvram -c
*enter your password at the prompt*
nvram -p

Confirm nvram -p produces no output except a blank line, then restart your computer. If this fixes your problem, excellent. If not, you can move on to the next troubleshooting step knowing you properly cleared your NVRAM.

The reason this can be a bit tricky to determine is that even when NVRAM is cleared, your computer still populates NVRAM with some default information during the start up process, which varies between particular machines. So after you restart, if you run nvram -p yet again, you'll see it's no longer blank.

The scenic route for the curious

If you haven't already done the above, but have tried the option + command + P + R method during startup, you can more exhaustively investigate your NVRAM by doing something like this:

nvram -p >> ~/Desktop/nvramBefore.txt
*expect a text file to be created on your Desktop*
sudo nvram -c
*enter your password*
nvram -p
*verify no output*
*restart computer*
nvram -p >> ~/Desktop/nvramAfter.txt

Then compare nvramBefore.txt to nvramAfter.txt manually or with a command line tool like sdiff. You should be able to see what your NVRAM looked like before you noodled with it and after.

Assuming you tried the key combinations during startup method before running these commands in Terminal, use the following as a guide as to what happened:

  • If the before/after files are the same or very similar: the keypress method worked.
  • If the before/after files are very different: the sudo nvram -c method worked.

You can delete your before and after files at this point if you're done or save them in a NVRAM folder with notes to investigate a particularly difficult problem.


For more info on NVRAM run nvram -h and man nvram in Terminal or visit: https://ss64.com/osx/nvram.html

Solution 2:

Doesn't appear to be a direct way to do this. Part of the problem is that your changes to the NVRAM, if you were to clear it (nvram -c), will not take effect until after a reboot.

You could try this method which will perform a side-by-side diff of the contents of NVRAM prior to running a nvram -c.

For example:

$ sdiff <(nvram -xp) <(nvram -c &> /dev/null; nvram -xp) | less

If there's any changes you should see lines with vertical bars (|) which will denote lines that changed. Content on the left side will be your before and content on the right will be your after.

References

  • How to View & Clear the Mac NVRAM Contents from Terminal in Mac OS X