CCNA online course

Cisco Device Memory Types: RAM, ROM, Flash, and NVRAM

Learn how RAM, ROM, flash, and NVRAM work in Cisco routers and switches, including bootup, IOS storage, configurations, commands, and troubleshooting.

Cisco routers and switches use several memory areas because different information has different requirements. The operating system needs fast working space, configuration data must sometimes survive a reboot, and software image files need persistent storage. Understanding these memory types makes Cisco startup behavior and configuration management much easier to predict.

The four traditional memory categories are RAM, ROM, flash memory, and NVRAM. Their physical implementation varies between legacy IOS devices, Catalyst switches, routers, and modern IOS XE platforms, but their conceptual roles remain important for CCNA study.

Why Cisco Devices Use Multiple Memory Areas

A Cisco device performs several jobs at once. It runs Cisco IOS or IOS XE, maintains routing and switching information, buffers packets, operates active services, and stores configuration data. One type of storage is not ideal for all these tasks.

  • Volatile memory loses its contents when the device reloads or loses power. It is useful for active, quickly changing information.
  • Nonvolatile memory retains its contents across a reload or power loss. It is useful for software, saved configurations, and recovery functions.

During startup, low-level code initializes the hardware, an IOS image is selected and loaded into working memory, and a saved configuration may be loaded into the active configuration. During normal operation, the device uses RAM for the operating system, configuration, tables, buffers, and active processes.

Cisco Memory Type Comparison

Memory typeVolatile or nonvolatilePrimary purposeCommon contentsEffect of reload or power lossTypical IOS filesystem or access method
RAMVolatileActive operating memoryIOS process, running-config, routing tables, ARP tables, MAC tables, packet buffers, and active processesContents are lostDisplayed indirectly through commands such as show version
NVRAMNonvolatileTraditional saved-configuration storagestartup-config and, on some platforms, other persistent dataContents remainAccessed through startup-config commands; exact implementation varies
FlashNonvolatile and erasablePersistent file storageIOS or IOS XE images, backups, package files, licenses, crash files, web assets, and platform-specific databasesContents remain unless changed or erasedflash:, bootflash:, usbflash0:, disk0:, or another platform-specific filesystem
ROMNonvolatileLow-level initialization and recoveryPOST functions, bootstrap code, firmware, and ROMMON-related functions on supported platformsContents remainUsed automatically during startup; ROMMON access varies by platform

RAM: Volatile Working Memory

RAM, or random-access memory, is the device's fast working memory. It is volatile, meaning that its contents disappear when the device is powered off or reloaded.

While a device is operating, RAM contains the active running configuration. Configuration commands normally change this in-memory configuration first. RAM also supports the IOS process, routing tables, ARP tables, switching or MAC address tables, packet buffers, and other active processes.

  • The routing process uses RAM to maintain routes and related protocol information.
  • A switch uses RAM for dynamically learned MAC address table entries.
  • ARP entries and other neighbor information occupy working memory.
  • Packets may wait temporarily in packet buffers held in RAM.
  • IOS processes and enabled services need RAM while the device runs.

Because the running configuration is in RAM, a configuration change can be active immediately without being permanent. If an administrator changes a hostname, interface address, or routing command and then reloads without saving, the change disappears.

RAM and Unsaved Changes

Suppose a student enters a hostname command. The command modifies running-config in RAM. The device uses the new hostname immediately, but the startup-config has not changed. A reload clears RAM and causes the device to build a new running configuration from the saved startup-config, if one exists.

Router# configure terminal
Router(config)# hostname Branch-Router
Router(config)# end
Router# reload

In this example, the hostname change is lost if the student does not first save it. The safe sequence is:

Router# copy running-config startup-config
Router# reload

NVRAM: Traditional Startup-Configuration Storage

NVRAM means nonvolatile random-access memory. It retains data through a reload and power loss. On traditional Cisco IOS devices, NVRAM stores the startup configuration.

The startup configuration is the saved configuration intended for the next boot. During a normal startup, the device copies the startup-config from its persistent location into RAM. The copied configuration becomes the running-config that controls operation.

Saving a configuration means copying the active running-config to the persistent startup-config:

Router# copy running-config startup-config

Older IOS documentation and command output may also use:

Router# write memory

These commands express the same basic operational idea: preserve the current configuration so it can be used after a reload.

Running Configuration Versus Startup Configuration

ConfigurationLocationWhen it changesPersistenceHow to view itHow to save or remove it
running-configRAMWhen configuration commands are entered or an active configuration is otherwise modifiedLost on reload or power loss unless savedshow running-configSave with copy running-config startup-config; remove individual settings with configuration commands
startup-configTraditionally NVRAM; implementation varies on newer platformsWhen a configuration is saved, copied, or restored to itRetained across reload and power lossshow startup-configReplace or save with copy commands; remove with erase startup-config when intended

Running-config and startup-config can contain different values. For example, an administrator can change an interface description in running-config, verify the result, and decide not to save it. A reload then restores the older startup-config.

Flash Memory: Persistent Erasable File Storage

Flash memory is nonvolatile storage that can be erased and rewritten. Cisco devices commonly use flash to store IOS or IOS XE image files. Flash may also contain configuration backups, VLAN databases on some platforms, web assets, licenses, crash files, and software package files.

At boot, the device normally locates an appropriate software image in flash and loads that image into RAM. Flash therefore provides persistent storage, while RAM provides the working space required to execute the image.

Flash capacity and free space matter during an image upgrade. A device can have enough RAM to run its current image but still lack enough free flash space for a replacement image. Before transferring or deleting files, identify the filesystem, image filename, file size, and available space.

Router# show flash:
Router# dir flash:
Router# show file systems

The name of the storage location varies. Examples include flash:, bootflash:, usbflash0:, and disk0:. Do not assume that a command or path from one hardware family applies unchanged to another.

Managing Files in Flash

IOS provides commands for listing, copying, and deleting files. A copy operation requires careful attention to the source and destination. For example, these commands illustrate transfers between flash and a TFTP server:

Router# copy flash: tftp:
Router# copy tftp: flash:

The first command can back up an image or other file from flash to a TFTP server. The second can transfer a file into flash. These examples do not by themselves prove that the image is compatible with the platform. Verify the image, connectivity, integrity, filename, and available storage before changing boot settings or reloading.

ROM: Low-Level Startup and Recovery Functions

ROM is nonvolatile memory that contains low-level functions needed before the full operating system is running. Its contents commonly include hardware initialization functions, POST, bootstrap code, and recovery or diagnostic functions.

POST, or power-on self-test, checks and initializes important hardware during startup. Bootstrap code then helps locate and load the operating system image. On many router platforms, ROMMON, or ROM Monitor mode, provides a recovery and diagnostic environment when normal IOS startup cannot complete.

ROM is not the usual location for the complete running configuration or the primary IOS image. Instead, it provides the low-level capability needed to begin booting, find an image, or recover from problems.

ROM contents and upgradeability vary by hardware generation. Some devices have functions that can be updated through a firmware process, while others have more fixed ROM behavior. For CCNA purposes, focus on ROM's role rather than assuming every model has identical ROM contents.

Normal Cisco Boot Process

The exact sequence differs by platform, but a normal boot follows this conceptual order:

  1. Hardware initialization and POST occur.
  2. Bootstrap or bootloader code executes.
  3. The device selects an IOS or IOS XE image using boot settings and platform defaults.
  4. The image is found in flash or another accessible storage location and loaded into RAM.
  5. The device looks for a startup configuration and loads it into RAM as running-config.
  6. IOS or IOS XE starts normal operation, including routing, switching, management, and packet forwarding processes.

Boot Sequence and Memory Use

Boot stageFunctionMemory or storage involvedFailure symptom or recovery direction
Hardware initialization and POSTChecks and initializes hardwareROM and hardware componentsHardware or POST errors; investigate platform-specific diagnostics
Bootstrap or bootloader executionBegins the operating system boot processROM and bootloader functionsBootloader prompt or recovery environment
IOS image discovery and loadingFinds a compatible image and loads it for executionFlash or another filesystem, then RAMBoot failure or ROMMON; check image presence, integrity, storage, and boot variables
Startup configuration loadingCopies saved settings into the active configurationTraditional NVRAM or platform-specific persistent storage, then RAMSetup behavior or default operation if no usable startup-config is found
Normal IOS operationRuns processes and forwards packetsRAM, flash for files, and persistent configuration storageResource or configuration problems; inspect show command output

The configuration register is a boot-control setting on applicable Cisco platforms. Its value can influence whether the device loads the startup configuration and how it attempts to boot an image. A device that behaves as though it has no configuration may have no startup-config, an erased startup-config, or a setting that bypasses it.

If no startup configuration is present, the device may enter an initial setup process or start with default behavior, depending on the platform and software version. If no valid IOS image can be found, the device may stop in a bootloader or ROMMON environment. Recovery then requires checking available storage, boot settings, and a platform-appropriate image recovery procedure.

The Configuration Lifecycle

Configuration changes normally follow this path:

  1. An administrator enters a command in configuration mode.
  2. The command changes running-config in RAM.
  3. The device begins using the change, subject to the command and service involved.
  4. The administrator verifies the result.
  5. copy running-config startup-config saves the intended state to persistent startup storage.
  6. During a later reload, the saved startup-config is copied back into RAM as running-config.

This lifecycle explains the most common configuration-storage mistake: changing a device successfully but forgetting to save it. A reload clears volatile RAM and discards unsaved changes.

Viewing, Saving, Restoring, and Removing Configuration

Router# show running-config
Router# show startup-config
Router# copy running-config startup-config
Router# copy startup-config running-config
Router# erase startup-config
Router# reload
  • show running-config displays the active configuration in RAM.
  • show startup-config displays the saved configuration.
  • copy running-config startup-config saves the active configuration for future boots.
  • copy startup-config running-config copies the saved configuration into the active configuration; behavior and prompts can vary by platform.
  • erase startup-config removes the saved configuration. It does not immediately clear the running-config in RAM.
  • reload restarts the device and clears volatile RAM contents. Unsaved changes are lost.

Commands for Inspecting Memory, Files, and Boot Settings

Use verification commands before making changes to storage or boot behavior:

Router# show version
Router# show file systems
Router# show flash:
Router# dir flash:
Router# show boot
Router# show running-config
Router# show startup-config
  • show version displays IOS or IOS XE version information, uptime, memory information, configuration-register details on supported platforms, and image-related information.
  • show file systems lists recognized filesystems and storage locations.
  • show flash: and dir flash: list files and help identify available flash space. The exact output depends on the platform.
  • show boot displays boot variables and configured boot image information on supported platforms.

To identify the active software image, examine show version and, where supported, show boot. Compare the active image with the files listed in the relevant filesystem. The image currently running does not necessarily mean that every image stored in flash is configured as a future boot image.

Troubleshooting Memory and Startup Problems

Changes Disappear After a Reload

Likely cause: The running configuration was changed but not copied to startup-config.

Router# show running-config
Router# show startup-config

If the active configuration is correct, save it before the next reload:

Router# copy running-config startup-config

The Device Enters Setup Mode or Has No Expected Configuration

Likely causes: No startup-config exists, it was erased, or the device was instructed to bypass it.

Check show startup-config and show version when IOS is available. Also check applicable boot and configuration-register settings. Restore or create the intended startup configuration and verify boot behavior.

Flash Reports Insufficient Space

Likely cause: The new image is larger than the available free space, or obsolete files occupy the filesystem.

Router# dir flash:
Router# show file systems

Confirm the required image size, back up files that must be retained, and identify only files that can safely be removed. Confirm platform compatibility before deleting an existing boot image.

The Device Does Not Boot IOS Normally

Likely causes: The image is missing, corrupt, incompatible, inaccessible, or not referenced by the boot settings.

If IOS is available, use show version and show boot. If the device is in a bootloader or ROMMON environment, inspect available storage and follow the recovery procedure appropriate to that hardware. Recovery may involve correcting boot settings or transferring a valid image to persistent storage.

Erasing the Configuration Does Not Remove Current Settings

Cause: Only startup-config was erased. The running-config remains in RAM until it is manually changed or the device is reloaded.

Router# show running-config
Router# show startup-config

If the goal is to start with the erased startup configuration, reload without saving the running configuration. Follow any platform-specific reset requirements and confirm that the device is not needed for production service.

Platform Differences

Traditional memory diagrams are useful, but they are conceptual rather than a promise that every Cisco product exposes identical physical components. Legacy IOS routers, Catalyst switches, and IOS XE platforms may use different hardware architectures and filesystem names.

  • A traditional device may expose NVRAM directly for startup-config.
  • A modern platform may store configuration in a different persistent filesystem while preserving the same running-versus-startup behavior.
  • IOS XE uses a different operating-system architecture from classic IOS, and software may be represented by packages or other components.
  • Switch-specific files, such as a VLAN database, may be stored differently depending on the platform.
  • Storage labels such as flash:, bootflash:, usbflash0:, and disk0: are not interchangeable assumptions.

For the CCNA, learn the functional roles: RAM holds active state, persistent storage holds files and saved data, ROM provides low-level startup functions, and boot processes move the required software and configuration into active memory.

Practical Scenarios

Unsaved Hostname Change

A student changes the hostname and reloads immediately. The new hostname was present in running-config in RAM but not in startup-config. Since reload clears RAM, the device returns to the saved hostname or its default behavior.

Saving Before Maintenance

An administrator verifies a working configuration before a maintenance window and runs copy running-config startup-config. The intended configuration is now persistent and can be loaded after reboot.

Enough RAM but Not Enough Flash

A router has sufficient RAM to execute an IOS image, but its flash filesystem lacks enough free space for a new image. RAM and flash have different jobs: execution capacity does not guarantee persistent image-storage capacity.

Missing Operating System Image

A device cannot locate a valid image during startup. It may remain in a bootloader or ROMMON environment. The administrator must inspect storage, confirm the image, check boot settings, and use a compatible recovery method.

Starting a Lab With No Saved Configuration

An administrator erases startup-config and reloads the device without saving the current running-config. Erasing startup-config removes persistent settings; reload then clears the active settings from RAM. The device may enter setup behavior or start with defaults depending on its platform.

Exam-Relevant Summary

  • RAM is volatile working memory. It holds running-config, IOS processes, routing and switching tables, ARP data, buffers, and active processes.
  • NVRAM is traditionally nonvolatile storage for startup-config.
  • Flash is erasable, nonvolatile file storage commonly containing IOS or IOS XE images and other files.
  • ROM contains low-level startup, POST, bootstrap, and recovery functions.
  • During normal boot, bootstrap functions run first, an image is loaded from persistent storage into RAM, and startup-config is loaded into RAM as running-config.
  • Configuration commands modify running-config first.
  • copy running-config startup-config saves intended changes across a reload.
  • erase startup-config does not immediately remove the running-config.
  • reload clears volatile RAM and loses unsaved changes.
  • Filesystem names and physical implementations vary, so use commands such as show file systems, show version, show boot, and dir flash: to inspect the actual device.

For broader Cisco fundamentals, review the computer network fundamentals, the IOS password configuration process, and OSPF configuration concepts.