I need to find a reliable way to save and restore the contents of NVRAM.

Would this be correct?


nvram -x -p > ~/nvram.xml


sudo nvram -x -f ~/nvram.xml
  • 1
    In reading the man page for nvram(8), the -f filename option states, "Set firmware variables from a text file. The file must be a list of "name value" statements. The first space on each line is taken to be the separator between "name" and "value". If the last character of a line is \, the value extends to the next line." and by my interpretation an XML file does not conform to those specifications, whereas a straight dump (just using the -p option) to a file does. I'd read the man page (in Terminal man nvram). Since I haven't tested this, I'm posting as a comment vs. an answer. – user3439894 Feb 22 '17 at 14:53
  • 1
    Also note it states "Changes to NVRAM variables are only saved by clean restart or shutdown.", so keep that in mind when restoring. – user3439894 Feb 22 '17 at 14:53

You must log in to answer this question.

Browse other questions tagged .