Upgrading an IOS Image into Flash Memory

IOS files typically are stored in Flash memory. Flash memory is rewriteable, permanent storage, which is ideal for storing files that need to be retained when the router loses power. Also, because there are no moving parts, there is a smaller chance of failure as compared with disk drives, which provides better availability. As you will read soon, IOS can be placed on an external TFTP server, but using an external server typically is done for testing—in production, practically every Cisco router loads an IOS stored in the only type of large, permanent memory, and that is Flash memory.

As Figure 2-10 illustrates, to upgrade an IOS image into Flash memory, you first must obtain the IOS image from Cisco. Then you must place the IOS image into the default directory of a TFTP server. Finally, you must issue the copy command from the router, copying the file into Flash memory.

NOTE You also can copy the IOS image directly from the FTP server. However, because the TFTP server function has been around a long time, I show it here. There could be plenty of exam questions left in the question database that cover TFTP.

Figure 2-10 Complete Cisco IOS Software Upgrade Process

Cisco Systems www.cisco.com

□ D

1

m

1

Snail mail

□ D

1

m

1

copy tftp flash

I Routed

Example 2-5 provides an example of the final step, copying the IOS image into Flash memory.

Example 2-5 copy tftp flash Command Copies the IOS Image to Flash Memory

R1#copy tftp flash

System flash directory: File Length Name/status

1 7530760 c4500-d-mz.120-2.bin [7530824 bytes used, 857784 available, 8388608 total]

Example 2-5 copy tftp flash Command Copies the IOS Image to Flash Memory (Continued)

Address or name of remote host [255.255.255.255]? 134.141.3.33

Source file name? c4500-d-mz.120-5.bin

Destination file name [c4500-d-mz.120-5.bin]?

Accessing file c4500-d-mz.120-5.bin ' on 134.141.3.33...

Loading c4500-d-mz.120-5.bin from 134.141.3.33 (via TokenRing0): ! [OK]

Erase flash device before writing? [confirm]

Flash contains files. Are you sure you want to erase? [confirm]

Copy 'c4500-d-mz.120-5.bin 1 from server as 'c4500-d-mz.120-5.bin ' into Flash WITH erase? [yes/no]y Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ...erased

Loading

! IIIIII

c4500-d-mz.120-5.bin from 134.141.3.33 (via TokenRing0): iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii

!!!!!!!!!!!!!!

iiiiiii

iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii

(leaving out

lots of

exclamation points...)

[OK - 7530760/8388608 bytes]

[OK - 7530760/8388608 bytes]

Verifying checksum... OK (0xA93E) Flash copy took 0:04:26 [hh:mm:ss] R1#

During this process of copying the IOS image into Flash memory, the router will need to discover several important facts:

1 What is the IP address or host name of the TFTP server?

2 What is the name of the file?

3 Is space available for this file in Flash memory?

4 Do you want the router to erase the old files?

The router will prompt you for answers, as necessary. Afterward, the router erases Flash memory as needed, copies the file, and then verifies that the checksum for the file shows that no errors occurred in transmission. The show flash command then can be used to verify the contents of Flash memory (see Example 2-6). (The show flash output can vary among router families.) Before the new IOS is used, however, the router must be reloaded.

Example 2-6 Verifying Flash Memory Contents with the show flash Command fred#show flash

System flash directory: File Length Name/status

1 6181132 c4500-d-mz.120-5.bin [4181196 bytes used, 4207412 available, 8388608 total] 8192K bytes of processor board System flash (Read ONLY)

In some cases, Flash memory could be in read-only mode. That is the case when a router loads only part of the IOS into RAM, to conserve RAM. Other parts of the IOS file are kept in Flash memory (Flash memory access time is much slower than RAM's). In this case, if Flash memory must be erased to make room for a new image, the IOS could not continue to run. So, if the router is running from a portion of IOS in Flash memory, the router first must be booted using IOS in ROM. Then the Flash memory will be in read/write mode and the erase and copy processes can be accomplished. The copy tftp flash command in later releases of the IOS actually performs the entire process for you. In earlier releases, you had to boot the router from ROM and then issue the copy tftp flash command.

Was this article helpful?

0 0

Post a comment