VMware ESXi and vSphere Cluster Management
Cisco Device Memory: ROM, RAM, NVRAM, and Flash
Learn how ROM, RAM, NVRAM, and flash support Cisco IOS startup, operation, configuration storage, and IOS image management.
Cisco IOS devices use several memory types, each with a different job. The four categories commonly taught are ROM, RAM, NVRAM, and flash memory.
Understanding these locations helps you predict what happens during startup, identify where an IOS image is stored, and explain why unsaved configuration changes disappear after a reload.
Volatile and Nonvolatile Memory
Volatile memory loses its contents when power is removed or the device reloads. Nonvolatile memory retains its contents across a power interruption.
RAM is the important volatile memory type in this lesson. ROM, NVRAM, and flash are traditionally treated as nonvolatile memory types. Modern Cisco platforms can implement these functions differently, but the traditional four-part model remains useful for learning IOS fundamentals.
| Memory type | Volatile or nonvolatile | Primary contents | Purpose | Retained after power loss |
|---|---|---|---|---|
| ROM | Nonvolatile | Bootstrap and other startup-level code | Begins low-level startup processing | Yes |
| RAM | Volatile | Executing IOS, running-config, tables, buffers, and temporary data | Provides working memory during operation | No |
| NVRAM | Nonvolatile | Traditionally, startup-config | Preserves the saved configuration for future startups | Yes |
| Flash | Nonvolatile | IOS image files and other supported files | Provides persistent file storage | Yes |
ROM: Startup-Level Code
ROM means read-only memory. In the traditional Cisco IOS model, ROM contains low-level startup code, including a bootstrap program.
The bootstrap program runs when the device powers on. It performs early initialization and participates in finding and loading system software. In a normal startup, it helps locate an IOS image, which is the Cisco Internetwork Operating System software file used to run the device.
ROM is not normally where the complete IOS image or the active configuration is stored. Its role is to provide enough startup-level functionality to begin the boot process and handle situations in which normal software loading does not occur.
ROM is nonvolatile, so its contents survive a reload and a power loss.
RAM: Working Memory
RAM means random-access memory. It is the device's working area while IOS is running.
- The IOS image is loaded into RAM so the processor can execute it.
- The active running-config is held in RAM.
- Operational tables, such as information used for forwarding and interfaces, consume RAM.
- IOS processes, packet buffers, and temporary runtime data also use RAM, depending on the platform.
The running-config is the currently active configuration. Commands that change the device during an IOS session usually change this RAM-resident configuration first.
RAM is volatile. Its contents disappear after a power loss or reload. Therefore, a configuration change that exists only in running-config is not automatically preserved.
NVRAM: Saved Configuration Storage
NVRAM means nonvolatile random-access memory. In the traditional Cisco IOS model, NVRAM stores the startup-config.
The startup configuration is the saved configuration that the device can use during its next startup. It is different from running-config:
- running-config: The active configuration currently held in RAM.
- startup-config: The saved configuration traditionally held in NVRAM and used for future startup.
During boot, the device can load the saved startup-config from NVRAM into RAM. After that process, the saved settings become part of the active running configuration.
NVRAM is nonvolatile, so startup-config remains available through a reboot or power interruption. On some newer platforms, the persistent configuration may use a different underlying storage implementation, but the startup-config concept remains important.
Flash Memory: Persistent File Storage
Flash memory is nonvolatile file storage. Cisco IOS image files are commonly stored in flash so the device can find and load its operating system during startup.
Flash can also contain other platform-supported files, including:
- Backup configuration files
- System files and packages
- Logs
- Licenses
- Additional IOS images
Flash may be implemented as onboard storage or as removable media, depending on the device. It is accessed through a file system, meaning the storage namespace and directory structure used to locate files.
Flash contents persist when the device loses power. However, persistent does not mean unlimited: an image or backup can be stored only if enough free capacity is available.
Conceptual Boot and Configuration Flow
A normal conceptual startup sequence looks like this:
- The device powers on and begins hardware startup.
- Startup-level code in ROM runs bootstrap processing.
- The bootstrap code identifies an IOS image, typically in flash.
- The IOS image is loaded into RAM.
- IOS begins executing from RAM.
- The device finds the saved startup-config, traditionally in NVRAM, and loads it into RAM as the running configuration.
This sequence connects the four memory roles:
- ROM: Starts the low-level boot process.
- Flash: Stores the IOS image that is retrieved during startup.
- RAM: Holds the executing IOS and active running-config.
- NVRAM: Stores the saved startup-config used to restore configuration after startup.
Exact boot behavior and storage implementation can vary by Cisco platform and IOS family. A platform may use multiple flash locations, a different persistent file system, or a modified startup process. The four-part model is a conceptual map, not a guarantee that every model uses identical physical components.
Configuration and IOS Storage Relationship
| Item | Typical storage location | When it is used | What happens after reload |
|---|---|---|---|
| IOS image | Flash | Retrieved during startup and loaded into RAM for execution | The image remains in flash; a usable image is loaded again if boot succeeds |
| Running configuration | RAM | Used as the active configuration while the device operates | Unsaved changes are lost |
| Startup configuration | NVRAM traditionally | Read during startup to establish the active configuration | Remains available for the next startup |
| Bootstrap code | ROM | Runs during the earliest startup processing | Remains available because ROM is nonvolatile |
Viewing Flash Contents
Use a flash directory command to inspect stored files. On many IOS platforms, the following commands are useful:
show flash:show flash: displays the contents of the default flash file system. dir flash: is an alternative directory-listing form supported by many IOS platforms.
Typical output may include:
- Directory or file-system information
- Filenames
- File sizes
- File types or attributes
- Total capacity and free space
To identify a likely IOS image, look for a relatively large file with an IOS image filename. The exact filename pattern depends on the hardware model, IOS family, software release, and feature set. Do not identify an image by name alone; also consider its size, file-system location, and compatibility with the platform.
Some devices use alternate file-system names or provide multiple flash locations. If the expected image is not listed under flash:, inspect the storage locations supported by that device.
Useful IOS Commands
show flash:Use these commands as follows:
show flash:ordir flash:lists files in flash and helps you check image files and available space.show running-configdisplays the active configuration held in RAM.show startup-configdisplays the saved configuration, traditionally stored in NVRAM.copy running-config startup-configsaves the active configuration so it can be used after a reload.
The save command copies the intended current configuration from its RAM-based running state to persistent startup storage. It does not copy the IOS image.
What a Reload or Power Failure Retains
Consider a configuration change made at the command line. The change appears in running-config immediately, but it is not necessarily in startup-config.
- A command changes the running configuration in RAM.
- The administrator does not run
copy running-config startup-config. - The device reloads or loses power.
- The RAM-resident change disappears.
- The device loads the older saved startup-config during the next startup.
The same distinction applies to software and configuration storage: an IOS image stored in flash is persistent, while the executing copy of IOS in RAM is recreated during startup. A saved configuration in NVRAM is persistent, while the active copy in RAM is rebuilt or updated as the device operates.
Practical Example: Mapping Device Information
Suppose you need to explain where the main pieces of a router's operating state are located:
- The bootstrap program begins in ROM.
- The IOS image file is stored in flash.
- The executing IOS and current running-config are held in RAM.
- The saved startup-config is traditionally stored in NVRAM.
This mapping explains why the device can retain an IOS image and saved configuration after power is removed, while still losing unsaved active changes.
Troubleshooting Memory and Storage Problems
Configuration changes disappear after reboot
The likely cause is that the changes existed only in running-config in RAM and were never saved to startup-config.
Before reloading, compare the two configurations:
show running-configIf the intended change is present only in running-config, save it with:
copy running-config startup-config
The expected IOS image is not in flash
The image may be missing, stored in another file system, or unavailable at the configured boot location. Begin with:
show flash:
Check other storage locations if the platform supports them. Then verify the correct image and boot settings using the device platform's software-management procedure.
There is not enough space for another IOS image
Inspect the flash directory output for total capacity, used space, and free space. Remove unneeded files only after confirming that they are not required for operation, recovery, or rollback. Use additional supported storage if appropriate.
Running-config and startup-config are confusing
Display both configurations and compare them. Running-config is the current RAM-resident configuration; startup-config is the saved configuration used for a future startup. They can differ until the active configuration is saved.
Summary
- ROM is nonvolatile read-only memory that contains startup-level code such as bootstrap functionality.
- RAM is volatile working memory that holds the executing IOS, running-config, tables, buffers, and temporary data.
- NVRAM is traditionally the nonvolatile location for startup-config.
- Flash is nonvolatile file storage commonly used for IOS images and other device files.
- During a normal boot, ROM bootstrap processing helps locate an IOS image in flash, loads IOS into RAM, and loads the saved configuration into the active running configuration.
- Changes made only to running-config are lost after reload or power failure; use
copy running-config startup-config to preserve them.