Полезная информация


Table of Contents

Maintaining Router Memory

Maintaining Router Memory

This chapter describes how to maintain and use the different types of memory on your router.

To benefit most from the instructions and organization of this chapter, your router must contain a minimal configuration that allows you to interact with the system software. You can create a basic configuration file using the setup command facility. See the user guide for your hardware platform for more information on using setup at first-time startup. See the "Using Setup for Configuration Changes" chapter in this publication for information on using setup after first-time startup.

For a complete description of the memory commands mentioned in this chapter, refer to the "Router Memory Commands" chapter in the Configuration Fundamentals Command Reference. To locate documentation of other commands that appear in this chapter, use the command reference master index or search online.

Note One or more of the commands that previously appeared in this chapter have been replaced by new commands. Table 15 maps the old commands to their replacements. The old commands continue to perform their normal functions in the current release, but support for these commands will cease in a future release.

Table 15: Mapping Old Commands to New Commands
Old Command New Command

copy erase flash

erase flash: (Class B Flash file systems only)

format (Class A and C Flash file systems only)

copy verify or copy verify flash

verify flash

verify flash:


copy verify bootflash

verify bootflash

verify bootflash:

Maintain Router Memory Task List

You can perform the tasks related to Flash memory in the following sections:

Format Flash Memory is a required first task if you are using a new PCMCIA Flash memory card on the Cisco 7000 family.

Note These tasks assume you have a minimal configuration that you want to modify.

Display Memory Information

Use the following commands in EXEC mode to display information about system memory:
Command Purpose

show flash-filesystem: [all | chips | filesys] (Class A Flash file systems)

show flash-filesystem: [partition number] [all | chips | detailed | err | summary] (Class B Flash file systems)

show flash-filesystem: (Class C Flash file systems)

List information about Flash memory.

show file systems

List the names of the file systems currently supported on the router.

Refer to the Configuration Fundamentals Command Reference for examples of these commands.

Compare Types of Memory

Your router has many different locations where it can store images, configuration files, and microcode. Refer to your hardware documentation for details on the following:


Dynamic random-access memory contains two types of memory:

On the Cisco  3600 series routers, you can use the memory-size iomem command to configure the proportion of DRAM devoted to main memory and to shared memory.


Erasable programmable read-only memory (EPROM). This memory is often referred to simply as ROM. It sometimes contains the following:


Nonvolatile random-access memory (NVRAM) stores the following information:


Flash memory stores the Cisco  IOS software image. On some platforms, it can store configuration files or boot images.

Depending on the hardware platform, Flash memory might be available as EPROMs, single in-line memory modules (SIMMs), or Flash memory cards. Check the appropriate hardware installation and maintenance guide for information about types of Flash memory available on a specific platform.

Depending on the platform, Flash memory is available in the following forms:

A Flash memory card that is inserted in to a Personal Computer Memory Card International Association (PCMCIA) slot. This card is used to store system images, boot images, and configuration files.
The following platforms contains PCMCIA slots:
Because the Cisco  3600 series and Cisco 7000 family can boot images and load configuration files from several locations, these systems use special ROM monitor environment variables to specify the location and filename of images and configuration files that the router is to use for various functions.
Some ciscoFlash MIB variables support the Flash file system on the Cisco 7000 family.
Note that the internal Flash and the Flash memory card cannot be used as a contiguous bank of Flash memory.

Write Protection

Flash memory provides write protection against accidental erasing or reprogramming.

Refer to your hardware documentation for information on security jumpers and write protect switches.

Run from Flash Systems

Many Cisco routers load the system image from flash storage into RAM in order to run the Cisco  IOS. However, some platforms, such as the Cisco 1600 Series and Cisco  2500 Series, execute the Cisco  IOS directly in Flash memory. These platforms are run-from-Flash memory systems.

If you want to partition Flash memory, you must use a relocatable image. Relocatable images can be run from any location in Flash and can download images to any location. If you are upgrading from a nonrelocatable image to a relocatable image, you must erase Flash memory during the download so that the image is downloaded as the first file in Flash memory. All images for run-from-Flash platforms from Cisco  IOS Release  11.0 and later are relocatable. See the "Image Naming Conventions" section in the "Loading and Maintaining System Images and Microcode" chapter to determine if your images are run-from-Flash images or are relocatable.

Reallocate DRAM Memory (Cisco  3600 series only)

DRAM memory in Cisco  3600 series routers is organized as one contiguous address space divided between processor memory and I/O memory. Depending on the type and number of network interfaces you have configured in the router, you may need to reallocate the DRAM memory partitioned to processor memory and I/O memory.

Cisco manufacturing configures most Cisco 3600 series routers to have 25 percent of the address space allocated to I/O memory and 75 percent allocated to processor memory. But for customer orders that require two or more ISDN PRI interfaces, DRAM memory is configured to provide 40  percent of the address space for I/O memory and 60 percent for processor memory. (See Figure 13.) Cisco Systems performs these DRAM memory adjustments before it ships each router.

Figure 13: Components and Uses of DRAM Memory for Cisco 3600 Series Routers

Note Routers running two or more ISDN PRI interfaces or 12 or more ISDN BRI interfaces require a DRAM memory configuration of 40 percent I/O memory and 60 percent processor memory.

However, there are cases where you may have to manually reallocate the DRAM memory split between processor memory and I/O memory after you have received a router from Cisco  Systems.

For example, suppose you receive a Cisco 3640 router with the following running configuration:

Later, however, you add a 4-port ISDN BRI network module to the router. You now have 12 ISDN BRI interfaces running on the router. At this point, you must use the memory-size iomem command to configure 40 percent of the address space for I/O memory and 60 percent for processor memory.

To view your current mix of processor and I/O memory and reassign memory distribution accordingly, use the following commands beginning in privileged EXEC mode:
Step Command Purpose

1 . 

show version

View the total amount of memory loaded on the router.

2 . 

show memory1

Determine the amount of free memory.

3 . 

configure terminal

Enter global configuration mode.

4 . 

memory-size iomem I/O-memory-percentage2

Allocate processor memory and I/O memory.

5 . 


Exit global configuration mode.

6 . 

copy system:running-config nvram:startup-config

Save the configuration to NVRAM.

7 . 


Reload the router to run the new image.

1The Free(b) column in the show memory command's output shows how much I/O memory is available.
2The default is 40 percent for I/O memory and 60 percent for processor memory.

Valid I/O memory percentage values are 10, 15, 20, 25, 30, 40 (the default), and 50. I/O memory size is the specified percentage of total memory size, rounded down to the nearest multiple of 1  MB. A minimum of 4 MB of memory is required for I/O memory. The remaining memory is processor memory.

The memory-size iomem command does not take effect until you save it to NVRAM using the copy system:running-config nvram:startup-config EXEC command and reload the router. However, when you enter the command, the software checks whether the new memory distribution leaves enough processor memory for the currently running Cisco  IOS image. If not, the following message appears:

Warning: Attempting a memory partition that does not provide enough Processor 
memory for the current image.If you write memory now, this version of software may not 
be able to run.

When you enter the reload command to run a new image, the software calculates the new processor and I/O memory split. If there is not enough processor memory, it automatically reduces I/O memory to an alternative setting to load the image. If there is still not enough processor memory for the image to run, then you do not have enough DRAM.

Reallocate Processor Memory and I/O Memory Examples

The following example allocates 40 percent of DRAM to I/O memory and the remaining 60 percent to processor memory. The example views the current allocation of memory, changes the allocation, saves the allocation, and reloads the router so the changes can take effect. In the show memory command output, the Free(b) column shows how much I/O memory is available:

Router# show memory
               Head   Total(b)    Used(b)    Free(b)  Lowest(b) Largest(b)
Processor  60913730    3066064         970420        2095644       2090736        2090892
      I/O    C00000    4194304       1382712        2811592       2811592       2805492
Router# configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)# memory-size iomem 40
Router(config)# exit
Router# copy system:running-config nvram:startup-config
Building configuration...
Router# reload
rommon > boot
program load complete, entry point: 0x80008000, size: 0x32ea24
Self decompressing the image : 
######################################################################## [OK]

Partition Flash Memory

On most Class B Flash file systems, you can partition banks of Flash memory into separate, logical devices so that the router can hold and maintain two or more different software images. This partitioning allows you to write software into Flash memory while running software in another bank of Flash memory.

Systems that Support Partitioning

To partition Flash memory, you must have at least two banks of Flash memory; a bank is a set of 4  chips. This requirement includes systems that support a single SIMM that has two banks of Flash memory. The minimum partition size is the size of a bank.

CiscoFlash MIB variables support partitioned Flash.

Benefits of Partitioning Flash Memory

Partitioning Flash memory provides the following benefits:

Flash Load Helper versus Dual Flash Bank

Flash load helper is a software option that enables you to upgrade system software on run-from-Flash systems that have a single bank of Flash memory. It is a lower-cost software upgrade solution than dual-bank Flash, which requires two banks of Flash memory on one SIMM. Flash load helper is only available on run-from-Flash platforms, such as the Cisco  2500 series, Cisco  3000, and Cisco 5200.

You might use Flash load helper rather than partitioning Flash into two banks for one of the following reasons:

See the "Use Flash Load Helper to Upgrade Software on Run-from-Flash Systems" section for information about using Flash load helper.

Partition Flash Memory

To partition Flash memory, use the following command in global configuration mode:
Command Purpose

partition flash partitions [size1 size2]

partition flash-filesystem: [number-of-partitions][partition-size] (Cisco  1600 series and Cisco  3600 series)

Partition Flash memory.

This task will succeed only if the system has at least two banks of Flash and the partitioning does not cause an existing file in Flash memory to be split across the partitions.

For all platforms except the Cisco  1600 series and Cisco  3600 series, Flash memory can only be partitioned into two partitions.

For the Cisco  1600 series and Cisco  3600 series, the number of partitions that you can create in a Flash memory device equals the number of banks in the device. Enter the show flash-filesystem: all command to view the number of banks on the Flash memory device. The number of partition size entries you set must be equal to the number of specified partitions. For example, the partition  slot0:  2  8  8 command configures two partitions to be 8 MB in size each. The first 8 corresponds to the first partition; the second 8 corresponds to the second partition.

Use Flash Load Helper to Upgrade Software on Run-from-Flash Systems

Flash load helper is a software option that enables you to upgrade system software on run-from-Flash systems that have a single bank of Flash memory. It is a lower-cost software upgrade solution than dual-bank Flash, which requires two banks of Flash memory on one SIMM.

The Flash load helper software upgrade process is simple and does not require additional hardware; however, it does require some brief network downtime. A system image running from Flash can use Flash load helper only if the boot ROMs support Flash load helper. Otherwise, you must perform the Flash upgrade manually. See the "Manually Boot from Flash Memory" section.

Flash load helper is an automated procedure that reloads the ROM-based image, downloads the software to Flash memory, and reboots to the system image in Flash memory. Flash load helper performs checks and validations to maximize the success of a Flash upgrade and minimize the chance of leaving Flash memory either in an erased state or with a file that cannot boot.

In run-from-Flash systems, the software image is stored in and executed from the Flash EPROM rather than from RAM. This method reduces memory cost. A run-from-Flash system requires enough Flash EPROM to hold the image and enough main system RAM to hold the routing tables and data structures. The system does not need the same amount of main system RAM as a run-from-RAM system because the full image does not reside in RAM. Run-from-Flash systems include the Cisco 2500 series and some Cisco 3000 series.

Flash Load Helper Features

Flash load helper includes the following features:

Flash load helper can also be used on systems with multiple banks of Flash memory that support Flash memory partitioning. Flash load helper enables you to download a new file into the same partition from which the system is executing an image.

For information about how to partition multiple banks of Flash memory so your system can hold two different images, see the "Partition Flash Memory" section.

Flash Load Helper Configuration Task List

Perform the commands in the following sections to use and monitor Flash load helper:

Download a File Using Flash Load Helper

To download a new file to Flash memory using Flash load helper, check to make sure that your boot ROMs support Flash load helper and then use one of the following commands in privileged EXEC mode:
Command Purpose

copy tftp: flash:

copy rcp: flash:

copy ftp: flash:

Download a new file to Flash memory.

The following error message displays if you are in a Telnet session and the system is set for manual booting (the boot bits in the configuration register are zero):

ERR: Config register boot bits set for manual booting

In case of any catastrophic failure in the Flash memory upgrade, this error message helps to minimize the chance of the system going down to ROM monitor mode and being taken out of the remote Telnet user's control.

The system tries to bring up at least the boot ROM image if it cannot boot an image from Flash memory. Before reinitiating the copy: command, you must set the configuration register boot field to a nonzero value, using the config-register global configuration command.

The copy command initiates a series of prompts to which you must provide responses. The dialog is similar to the following:

Router# copy tftp: flash:
*************************** NOTICE *******************************
Flash load helper v1.0
This process will accept the TFTP copy options and then terminate
the current system image to use the ROM based image for the copy. 
Router functionality will not be available during that time. If 
you are logged in via telnet, this connection will terminate. Users 
with console access can see the results of the copy operation.
There are active users logged into the system. 
Proceed? [confirm] y
System flash directory:
File Length   Name/status
1       2251320 abc/igs-kf.914
[2251384 bytes used, 1942920 available, 4194304 total]
Address or name of remote host []?
Source file name? abc/igs-kf.914
Destination file name [default = source name]? <Return>
Accessing file `abc/igs-kf.914' on
Loading from
Erase flash device before writing? [confirm] n
File `abc/igs-kf.914' already exists; it will be invalidated!
Invalidate existing copy of `abc/igs-kf.914' in flash memory? [confirm] y
Copy `abc/igs-kf.914' from TFTP server
as `abc/igs-kf.914' into Flash WITHOUT erase? y
%SYS-5-RELOAD: Reload requested
%FLH: rxboot/igs-kf.914r from to flash...

The Flash Load Helper operation verifies the request from the running image by trying to copy a single block from the remote server. Then the Flash load helper is executed, causing the system to reload to the ROM-based system image. If the file does not seem to be a valid image for the system, a warning is displayed and a separate confirmation is sought from you.

If the configuration has been modified but not yet saved, you are prompted to save the configuration:

System configuration has been modified. Save? [confirm]

Users with open Telnet connections are notified of the system reload, as follows:

**System going down for Flash upgrade**

If the copy process fails, the copy operation is retried up to three times. If the failure happens in the middle of a copy operation so that only part of the file has been written to Flash memory, the retry does not erase Flash memory unless you specified an erase operation. The partly written file is marked as deleted, and a new file is opened with the same name. If Flash memory runs out of free space in this process, the copy operation is terminated.

After Flash load helper finishes copying (whether the copy operation is successful or not), it automatically attempts an automatic or a manual boot, depending on the value of bit zero of the configuration register boot field according to the following:

Monitor Flash Load Helper

To view the system console output generated during the Flash load helper operation, use the image that has been booted up after the Flash memory upgrade. Use the following command in privileged EXEC mode:
Command Purpose

more flh:logfile

View the console output generated during the Flash load helper operation.

If you are a remote Telnet user performing the Flash upgrade without a console connection, this task allows you to retrieve console output when your Telnet connection has terminated due to the switch to the ROM image. The output indicates what happened during the download, and is particularly useful if the download fails.

Format Flash Memory

On Class A and Class C Flash file systems, you can format Flash memory. Formatting erases all information in Flash memory.

On the Cisco 7000 family, you must format a new Flash memory card before using it in a PCMCIA slot.

Flash memory cards have sectors that can fail. You can reserve certain Flash memory sectors as "spares" for use when other sectors fail. Use the format command to specify between 0 and 16  sectors as spares. If you reserve a small number of spare sectors for emergencies, you do not waste space because you can use most of the Flash memory card. If you specify zero spare sectors and some sectors fail, you must reformat the Flash memory card and thereby erase all existing data.

The format operation requires at least Cisco IOS Release 11.0 system software.

Format Flash Memory Process

Caution The following formatting procedure erases all information in Flash memory. To prevent the loss of important data, proceed carefully.

Use the following procedure to format Flash memory. If you are formatting internal Flash memory, such as bootflash, you can skip the first step. If you are formatting a Flash memory card, complete both steps.

Step 1 Insert the new Flash memory card into a PCMCIA slot. Refer to instructions on maintaining the router and replacing PCMCIA cards in your router's hardware documentation for instructions on performing this step.

Step 2 Format Flash memory.

To format Flash memory, use the following EXEC mode command:
Command Purpose

format [spare spare-number] device1: [[device2:][monlib-filename]] (Class A Flash file systems)

Format Flash memory.

The following example shows the format command that formats a Flash memory card inserted in slot 0.

Router# format slot0:
Running config file on this device, proceed? [confirm]y
All sectors will be erased, proceed? [confirm]y
Enter volume id (up to 31 characters): <Return>
Formatting sector 1 (erasing)
Format device slot0 completed

When the router returns you to the EXEC prompt, the new Flash memory card is successfully formatted and ready for use.

Recovering from Locked Blocks

To recover from locked blocks, reformat the Flash memory card. A locked block of Flash memory occurs when power is lost or a Flash memory card is unplugged during a write or erase operation. When a block of Flash memory is locked, it cannot be written to or erased, and the operation will consistently fail at a particular block location. The only way to recover from locked blocks is by reformatting the Flash memory card with the format command.

Caution Formatting a Flash memory card to recover from locked blocks will cause existing data to be lost.

Copyright 1989-1998 © Cisco Systems Inc.