Which command will display the contents of nvram? If you’ve ever poked around a router, a switch, or an embedded Linux box, you’ve probably wondered where the device keeps its startup settings and how you can peek at them. The answer isn’t always a single, universal line—different vendors and operating systems treat NVRAM a little differently—but once you know the patterns, the right command shows up almost instinctively.
What Is NVRAM and Why Does It Matter?
NVRAM stands for non‑volatile random‑access memory. Worth adding: unlike the regular RAM that loses its data when power is cut, NVRAM holds onto information even after a device is rebooted or loses electricity. In networking gear, that usually means the startup configuration, the config register, or a small set of persistent variables that tell the device how to boot up and what to run first.
Think of it as the device’s long‑term memory. If you change the running configuration and then issue a write memory or copy running-config startup-config command, the router copies those changes into NVRAM so they survive the next power cycle. Which means when the device boots, it reads the startup config from NVRAM and builds the running configuration from there. If NVRAM is corrupted or empty, the router may fall back to a default state, or worse, refuse to boot altogether Small thing, real impact..
That’s why being able to view the contents of NVRAM is a basic troubleshooting skill. Whether you’re verifying that a backup really took hold, checking for a typo that survived a reload, or confirming that a password recovery procedure actually cleared the secret, you need a reliable way to look inside that memory chip And that's really what it comes down to..
How to Display NVRAM Contents on Common Platforms
The exact command varies, but the idea is the same: ask the operating system to dump the data stored in its non‑volatile memory. Below are the most common ways you’ll encounter in the field.
Cisco IOS and IOS XE
On Cisco routers and switches running IOS (or the newer IOS XE), the startup configuration lives in NVRAM. The command to view it is:
show startup-config
That’s it. The output you see is exactly what’s stored in NVRAM, line for line. If you want a more raw view—useful when you suspect non‑printable characters or hidden data—you can also use:
show nvram
On many platforms, show nvram prints a hexadecimal dump of the entire NVRAM chip, including the config register and any environmental variables. Most administrators stick with show startup-config because it’s already formatted as readable Cisco commands Simple, but easy to overlook. And it works..
Cisco NX‑OS (Nexus Switches)
Nexus switches use a slightly different file system, but the concept is identical. The startup config is kept in the bootflash: partition, which is backed by NVRAM. To view it:
show startup-config
Again, the same command works. If you need the raw NVRAM dump, Nexus offers:
show nvram
Juniper Junos
Juniper devices store the active configuration in /var/db/config/ and the rescued or backup configs in similar locations, but the equivalent of NVRAM is the /config directory that survives reboots. The command to see the saved configuration is:
show configuration | display set
If you want the exact file as it sits on the flash (which is backed by NVRAM on many Junos platforms), you can look at:
file show /config/juniper.conf
That will spit‑file is the non‑volatile copy Junos loads on boot Surprisingly effective..
Linux‑Based Embedded Systems (e.g., OpenWrt, DD‑WRT)
Many home‑router firmwares are built on Linux and keep NVRAM variables in a simple key‑value format. The utility to read them is usually nvram itself:
nvram show
That prints every variable name and its value, things like boot_wait, et0macaddr, or dl_file. If you just want one variable:
nvram get boot_wait
On some systems, the NVRAM storage is a raw MTD partition, and you can dump it with:
dd if=/dev/mtd0 of=/tmp/nvram.bin
hexdump -C /tmp/nvram.bin
But for day‑to‑day work, the nvram command is the go‑to It's one of those things that adds up. Took long enough..
Windows Embedded (e.g., Windows IoT Core)
Windows doesn’t expose NVRAM the same way, but firmware variables (UEFI) can be read with:
bcdedit /enum all
Or, using PowerShell:
Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
Those aren’t the traditional router NVRAM, but they serve a similar purpose for persisting boot options Nothing fancy..
Common Mistakes People Make When Trying to View NVRAM
Even seasoned engineers slip up now and then. Here are a few pitfalls that show up repeatedly.
Assuming “show running-config” Is Enough
It’s tempting to think that if you can see the running config, you’ve seen everything that matters. But the running config lives in volatile RAM; any unsaved changes disappear on reload. If you’re troubleshooting a device that boots into a default state, looking at show running-config will mislead you—it will be empty or show only the defaults, while the real problem might be a corrupted startup config in NVRAM.
Forgetting to Save Before Reloading
You make a bunch of changes, test them, then reload the router to see if they survive. So if you forgot to issue write memory (or copy running-config startup-config), the NVRAM still holds the old configuration. Consider this: after the reload, you’ll be scratching your head wondering why your tweaks vanished. Always verify that the show startup-config output matches what you expect before you power‑cycle.
Misreading Hex Dumps as Plain Text
When you use show nvram on Cisco** command on other platforms, you might get a wall. Because of that, it’s easy to start trying to read it like a config. You see recognizable commands conclude the NVRAM is empty or corrupted. In reality, the device may be storing the the data in a compressed format. Stick with formatted output first, really need the raw data, pair it with a known good reference or a script that format That's the whole idea..
Overlooking Permissions
On you try multi‑user, the command might show permission error. You don’t have root read NVRAM. partition. Use sudo or become level before trying to access.
Confusing Different Types
Some platforms have more than one NVRAM region—one for the bootloader, one for the main OS, maybe another for radio calibration data on wireless gear. Dumping the wrong region can give you gibberish or,
Confusing Different Types (continued)
Some platforms expose multiple NVRAM‐like regions, each with its own purpose:
| Device | Region | Typical Contents | Typical CLI |
|---|---|---|---|
| Cisco | nvram: |
IOS image, boot variables, startup‑config | show nvram: |
| Juniper | /var/nvram |
Junos config, license keys | file show /var/nvram |
| OpenWrt | /etc/config/ (filesystem) |
Persistent config files | uci show |
| U-Boot | mtd0 |
Bootloader environment, bootargs | fw_printenv |
The official docs gloss over this. That's a mistake.
Dumping mtd0 on a device that actually uses a separate mtd1 for the bootloader can produce an unrelated image. Always refer to the vendor’s documentation to confirm which partition holds the data you need.
Practical Tips for Reliable NVRAM Inspection
| Situation | What to Do | Why It Helps |
|---|---|---|
| You suspect a corrupted startup config | show startup-config + show running-config |
Confirms whether the config was loaded correctly. Plus, |
| You need to compare two devices | show nvram: and show startup-config on both |
Identifies differences that might cause divergent behavior. |
| You’re debugging a firmware upgrade | Dump the NVRAM before and after the upgrade | Detects unintended changes to boot variables. |
| You’re working with a new vendor | Read the vendor’s “NVRAM and Backup” guide | Avoids common pitfalls and ensures you use the right tool. |
| You’re automating backups | Script copy startup-config tftp://<server>/ or nvram dump |
Provides a repeatable, auditable backup process. |
Use “diff” Wisely
When comparing configurations, it’s tempting to run diff on the raw text. That said, many routers add timestamps or variable placeholders that change on every boot. Filter out those lines first:
show startup-config | grep -v '^Building configuration' | sort > cfg1.txt
show startup-config | grep -v '^Building configuration' | sort > cfg2.txt
diff cfg1.txt cfg2.txt
This produces a clean diff that focuses on the real differences.
Verify Integrity with Checksums
If the NVRAM image is large or you’re concerned about corruption, compute a checksum:
dd if=/dev/mtd0 bs=1M | sha256sum
Store the hash in a secure location. Later, re‑run the command and compare to detect any silent corruption Nothing fancy..
Keep a Version History
NVRAM is a single point of truth, but it can be overwritten by accidental reboots or firmware restores. Maintain a versioned backup strategy:
- Pre‑upgrade backup – wyposaż w
copy startup-config tftp://ornvram dump. - Post‑upgrade verification – re‑dump and compare.
- Regular snapshots – schedule daily or weekly backups to a secure server.
Versioning turns a one‑off snapshot into a powerful forensic tool Simple, but easy to overlook..
When All Else Fails: Recovering a Corrupted NVRAM
- Boot into safe mode (e.g., Cisco’s
rommonor Juniper’scli safe) to prevent the device from loading a bad config. - Erase the NVRAM using the vendor’s erase command (
erase nvram:orerase startup-config). - Restore from backup –Četrieve the last known‑good config via TFTP, SCP, or a USB stick.
- Validate – run
show startup-configandshow running-configto confirm the restore succeeded. - Reboot – allow the device to load the restored config and verify operational status.
If the device refuses to boot after an erase, consult the hardware manual for a low‑level recovery procedure (e.Think about it: g. , flashing the bootloader).
Conclusion
NVRAM is the unseen backbone of every network device, holding the configuration that survives power cycles and firmware upgrades. While the commands to interrogate it differ across vendors, the core principles remain the same:
- Always validate that you’re looking at the right region; misuse of partitions leads to confusion.
- Use formatted output first; raw dumps are useful but harder to interpret.
- Back up before you touch; a single accidental command can wipe a critical configuration.
- Automate and version; a disciplined backup strategy protects against human error and hardware failure.
- Know the vendor’s quirks; each OS has its own idiosyncrasies that can trip up even seasoned engineers.
By treating NVRAM with the same rigor you reserve for code or database backups, you’ll reduce downtime, simplify troubleshooting, and keep your network’s heartbeat steady. Whether you’re a field engineer, a systems administrator, or a hobbyist tinkering with a home router, mastering NVRAM inspection is a small but essential skill that pays dividends in reliability and peace of mind.