Cisco 1800 Series Software Configuration
Troubleshooting and Maintenance: Using CompactFlash Memory Cards
Downloads: This chapterpdf (PDF - 255.0KB) | Feedback

Using CompactFlash Memory Cards

Table Of Contents

Using CompactFlash Memory Cards

Platforms Supported by This Document

Requirements and Restrictions

Online Insertion and Removal

How to Format CompactFlash Memory Cards

Determining the File System on a CompactFlash Memory Card

Formatting CompactFlash Memory as a Class B Flash File System

Formatting CompactFlash Memory as a Class C File System

File Operations on CompactFlash Memory Cards

Copying Files

Displaying Files

Displaying File Content

Displaying Geometry and Format Information (Class C Only)

Deleting Files

Renaming Files

Directory Operations on a CompactFlash Memory Card

Entering a Directory and Determining Which Directory You Are In

Creating a New Directory

Removing a Directory


Using CompactFlash Memory Cards


Cisco 3800 series routers, Cisco 2800 series routers, and Cisco 1800 series routers use external CompactFlash (CF) memory cards to store the system image, some software feature data, and configuration files. The CF memory cards use the following file systems. The file system that is supported depends on router model:

Class B flash file system, also known as the low-end file system (LEFS)

Class C flash file system, similar to the standard DOS file system

This document contains the following sections:

Platforms Supported by This Document

Requirements and Restrictions

Online Insertion and Removal

How to Format CompactFlash Memory Cards

File Operations on CompactFlash Memory Cards

Directory Operations on a CompactFlash Memory Card

Platforms Supported by This Document

Use this document with the following platforms:

Cisco 1800 series routers

Cisco 2800 series routers

Cisco 3800 series routers

Requirements and Restrictions

Cisco 3800 series routers, Cisco 2800 series routers, and Cisco 1800 series routers do not support internal flash memory. Because the system image can be stored only on a CF memory card, you need to have a CF memory card installed to boot the system image.

We recommend that you erase (Class B) or format (Class C) new CF memory cards to initialize them with either a Class B or Class C flash file system. This ensures proper formatting and enables the ROM monitor to recognize and boot the flash memory.

Only CF memory cards purchased from Cisco are supported on these platforms.

Cisco 1800 Series Routers and Cisco 2801 Routers

Support only the Class C flash file system.

Support only external CF memory cards.

The CF memory card file system can be formatted on a Cisco 1800 series router or Cisco 2801 router. After the file system has been formatted, files on the CF memory card can be copied to or from any PC that is equipped with a CF memory reader. If you use a PC to format the CF memory card, use only the Microsoft 16-bit File Allocation Table (FAT16) file system.

Cisco 3800 Series Routers and Cisco 2800 Series Routers (Except for Cisco 2801 Routers)

Support Class B and Class C flash file systems.

Support only external CF memory cards.

If you use a PC to format the CF memory cards, you can format the cards with the Microsoft 16-bit File Allocation Table (FAT16), Microsoft 32-bit File Allocation Table (FAT32), or Microsoft Windows NT file system (NTFS). Alternatively, you can format the CF memory card on the router.


Note When formatted on the router, flash memory cards are formatted with the DOSFS file system, a platform-independent industry-standard file system that is supported on all Cisco 3800 series routers, Cisco 2800 series routers, and Cisco 1800 series routers.


Online Insertion and Removal

Online insertion and removal (OIR) is a feature that allows you to replace CF memory cards without turning off the router and without affecting the operation of other interfaces. OIR of CF memory cards provides uninterrupted operation to network users, maintains routing information, and ensures session preservation.


Caution The external CF memory card should not be removed if the flash memory busy "CF" LED on the router is ON, because this indicates that the software is accessing the CF memory card. Removing the CF memory card may disrupt the network, because some software features use the CF memory card to store tables and other important data.

For instructions on inserting, removing, and replacing the external CF memory card, see the hardware installation documentation that came with your router.

How to Format CompactFlash Memory Cards

This section contains the following procedures:

Determining the File System on a CompactFlash Memory Card

Formatting CompactFlash Memory as a Class B Flash File System

Formatting CompactFlash Memory as a Class C File System

Determining the File System on a CompactFlash Memory Card

To determine the file system of a CF memory card, enter the show flash: all command in privileged EXEC mode.

If geometry and format information does not appear in the output, the card is formatted with a Class B flash file system.

If geometry and format information appears in the output, the card is formatted with a Class C flash file system.

The following examples show sample outputs for Class B and Class C flash file systems.

External Card with Class B Flash File System: Example

The geometry and format information does not appear.

Router# show flash: all

Partition   Size    Used      Free      Bank-Size  State          Copy
Mode
  1        125184K  20390K    104793K        0K      Read/Write
Direct

System Compact Flash directory:
File  Length   Name/status
        addr      fcksum  ccksum
  1   6658376  c28xx-i-mz
        0x40      0xE0FF  0xE0FF
  2   14221136  c2800-telcoent-mz
        0x6599C8  0x5C3D  0x5C3D
[20879640 bytes used, 107308776 available, 128188416 total]
125184K bytes of ATA System Compact Flash (Read/Write)

 Chip information NOT available.

External Card with Class C Flash File System: Example

The geometry and format information is displayed in this format.

Router# show flash: all

-#- --length-- -----date/time------ path
1      6658376 Mar 01 2004 04:27:46 c28xx-i-mz

25268224 bytes available (6664192 bytes used)

******** ATA Flash Card Geometry/Format Info ********

ATA CARD GEOMETRY
   Number of Heads:      4
   Number of Cylinders    490
   Sectors per Cylinder   32
   Sector Size            512
   Total Sectors          62720

ATA CARD FORMAT
   Number of FAT Sectors  31
   Sectors Per Cluster    8
   Number of Clusters     7796
   Number of Data Sectors 62560
   Base Root Sector       155
   Base FAT Sector        93
   Base Data Sector       187

Formatting CompactFlash Memory as a Class B Flash File System

Use the erase flash: command in privileged EXEC mode to

Format CF memory cards with a Class B flash file system

Remove the files from a CF memory card previously formatted with a Class B flash file system

Formatting CompactFlash Memory as a Class B Flash File System: Example

Router# erase flash:

Erasing the flash filesystem will remove all files! Continue? [confirm]
Current DOS File System flash card in flash: will be formatted into Low
End File System flash card!  Continue? [confirm]
Erasing device...
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
...erased
Erase of flash: complete

Formatting CompactFlash Memory as a Class C File System

Use the format flash: command in privileged EXEC mode to:

Format CF memory cards with a Class C flash file system

Remove the files from a CF memory card previously formatted with a Class C flash file system

Formatting CompactFlash Memory as a Class C Flash File System: Example

Router# format flash:

Format operation may take a while. Continue? [confirm]
Format operation will destroy all data in "flash:".  Continue? [confirm]
Enter volume ID (up to 64 chars)[default flash]:
Current Low End File System flash card in flash will be formatted into DOS
File System flash card!  Continue? [confirm]
Format:Drive communication & 1st Sector Write OK...
Writing Monlib sectors ..................................................................
Monlib write complete
Format:All system sectors written. OK...
Format:Total sectors in formatted partition:250592
Format:Total bytes in formatted partition:128303104
Format:Operation completed successfully.
Format of flash complete

File Operations on CompactFlash Memory Cards

File and directory operations vary according to the formatted file system—Class B or Class C.

This section describes the following file operations for external CF memory cards:

Copying Files

Displaying Files

Displaying File Content

Displaying Geometry and Format Information (Class C Only)

Deleting Files

Renaming Files

Copying Files

To copy files, enter the copy command in privileged EXEC mode. To indicate a file that is stored in a CF memory card, precede the filename with flash:.

Examples: Copying Files

In the following example, the file my-config1 on the CF memory card is copied into the startup-config file in the system memory:

Router# copy flash:my-config1 startup-config

Destination filename [startup-config]?
[OK]
517 bytes copied in 4.188 secs (129 bytes/sec)

In the following example, the file my-config2 on the CF memory card is copied into the running-config file in the system memory:

Router# copy flash:my-config2 running-config

Destination filename [running-config]?
709 bytes copied in 0.72 secs

Displaying Files

To display a list of files on a CF memory card, enter the dir flash: command in privileged EXEC mode:

Router# dir flash:

Directory of flash:/
 1580  -rw-     6462268   Mar 06 2004 06:14:02  c28xx-i-mz.3600ata
    3  -rw-     6458388   Mar 01 2004 00:01:24  c28xx-i-mz
63930368 bytes total (51007488 bytes free)

Displaying File Content

To display the content of a file that is stored in flash memory, enter the more flash: command in privileged EXEC mode:

Router# more flash:c28xx-i-mz

00000000: 7F454C46 01020100 00000000 00000000    .ELF .... .... ....
00000010: 00020061 00000001 80008000 00000034    ...a .... .... ...4
00000020: 00000054 20000001 00340020 00010028    ...T  ... .4.  ...(
00000030: 00050008 00000001 0000011C 80008000    .... .... .... ....
00000040: 80008000 00628A44 00650EEC 00000007    .... .b.D .e.l ....
00000050: 0000011C 0000001B 00000001 00000006    .... .... .... ....
00000060: 80008000 0000011C 00004000 00000000    .... .... ..@. ....
00000070: 00000000 00000008 00000000 00000021    .... .... .... ...!
00000080: 00000001 00000002 8000C000 0000411C    .... .... ..@. ..A.
00000090: 00000700 00000000 00000000 00000004    .... .... .... ....
000000A0: 00000000 00000029 00000001 00000003    .... ...) .... ....
000000B0: 8000C700 0000481C 00000380 00000000    ..G. ..H. .... ....
000000C0: 00000000 00000004 00000000 0000002F    .... .... .... .../
000000D0: 00000001 10000003 8000CA80 00004B9C    .... .... ..J. ..K.
000000E0: 00000020 00000000 00000000 00000008    ...  .... .... ....
000000F0: 00000000 0000002F 00000001 10000003    .... .../ .... ....
00000100: 8000CAA0 00004BBC 00623FA4 00000000    ..J  ..K< .b?$ ....
00000110: 00000000 00000008 00000000 3C1C8001    .... .... .... <...
00000120: 679C4A80 3C018001 AC3DC70C 3C018001    g.J. <... ,=G. <...
00000130: AC3FC710 3C018001 AC24C714 3C018001    ,?G. <... ,$G. <...
00000140: AC25C718 3C018001 AC26C71C 3C018001    ,%G. <... ,&G. <...
00000150: AC27C720 3C018001 AC30C724 3C018001    ,'G  <... ,0G$ <...
00000160: AC31C728 3C018001 AC32C72C 3C018001    ,1G( <... ,2G, <...
--More-- q

Displaying Geometry and Format Information (Class C Only)

To display the geometry and format information of a CF memory card formatted with a Class C flash file system, enter the show flash: filesys command in privileged EXEC mode:

Router# show flash: filesys

******** ATA Flash Card Geometry/Format Info ********

ATA CARD GEOMETRY
   Number of Heads:      4
   Number of Cylinders    490
   Sectors per Cylinder   32
   Sector Size            512
   Total Sectors          62720

ATA CARD FORMAT
   Number of FAT Sectors  31
   Sectors Per Cluster    8
   Number of Clusters     7796
   Number of Data Sectors 62560
   Base Root Sector       155
   Base FAT Sector        93
   Base Data Sector       187

Deleting Files

To delete a file from a CF memory card, enter the delete flash: command.

If you are using a Class B flash file system, after you enter the delete flash: command, the memory space of the deleted file remains occupied, although the deleted file cannot be recovered. To reclaim the memory space occupied by a deleted file, enter the squeeze flash: command, in privileged EXEC mode.


Note The squeeze flash command applies only to the Class B flash file system. This command is unnecessary with Class C flash file systems, because unused file space is recovered automatically. Moreover, the squeeze flash command is not supported on Cisco 1800 series routers or Cisco 2801 routers.



Note The dir flash: command does not display deleted files and files with errors. On Class B flash file systems, to display all files, including files with errors and deleted files whose memory space have not been reclaimed with the squeeze flash: command, enter the dir /all flash: command or the show flash: command in privileged EXEC mode.


Deleting a File from a CompactFlash Memory Card with a Class B Flash File System: Example

In the following example, the file c28xx-i-mz.tmp is deleted from the external CF memory card:

Router# delete flash:c28xx-i-mz.tmp

Delete filename [c28xx-i-mz.tmp]?
Delete flash:c28xx-i-mz.tmp? [confirm]

Because the file was deleted, it does not appear when you enter the dir flash: command:

Router# dir flash:

Directory of flash:/
1580  -rw-     6462268   Mar 06 2004 06:14:02  c28xx-i-mz.3600ata
    3  -rw-     6458388   Mar 01 2004 00:01:24  c28xx-i-mz
63930368 bytes total (51007488 bytes free)

However, if you are using a Class B file system, because the deleted file's memory space has not yet been reclaimed, the deleted file is listed when you enter the show flash: command:

Router# show flash:

Flash Compact Flash directory:
File  Length   Name/status
   1   6458208  c28xx-i-mz.tmp [deleted]
   2   6458208  c28xx-i-mz
[12916544 bytes used, 3139776 available, 16056320 total]
15680K bytes of ATA Compact Flash (Read/Write)

To reclaim the memory space of deleted files, enter the squeeze flash: command:

Router# squeeze flash:

Squeeze operation may take a while. Continue? [confirm]
squeeze in progress...
sssssssssssssssssssssssseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
Rebuild file system directory...
Squeeze complete

Renaming Files

To rename a file on a CF memory card, enter the rename command in privileged EXEC mode:

Router# dir flash:

Directory of flash:/

    3  -rw-     6458388   Mar 01 2004 00:00:58  c28xx-i-mz.tmp
 1580  -rw-     6462268   Mar 06 2004 06:14:02  c28xx-i-mz.3600ata

63930368 bytes total (51007488 bytes free)

Router# rename flash:c28xx-i-mz.tmp flash:c28xx-i-mz

Destination filename [c28xx-i-mz]?

Router# dir flash:

Directory of flash:/

 1580  -rw-     6462268   Mar 06 2004 06:14:02  c28xx-i-mz.3600ata
    3  -rw-     6458388   Mar 01 2004 00:01:24  c28xx-i-mz

63930368 bytes total (51007488 bytes free)

Directory Operations on a CompactFlash Memory Card

Directory operations vary according to the formatted file system—Class B or Class C.

The following sections describe directory operations for external CF memory cards on Cisco routers:

Entering a Directory and Determining Which Directory You Are In

Creating a New Directory

Removing a Directory

Entering a Directory and Determining Which Directory You Are In

To enter a directory of a CF memory card, enter the cd command in privileged EXEC mode. The cd command specifies or changes the default directory or file system. If you enter cd only, without specifying a file system, the router enters the default home directory, which is flash.

Router# cd

To determine which directory you are in, enter the pwd command in privileged EXEC mode. The CLI displays which directory or file system is specified as the default by the cd command.

Router# pwd
flash:

To display a list of files in the directory that you are in, enter the dir command in privileged EXEC mode. The command-line interface will display the files in the file system that was specified as the default by the cd command.

Router# dir

Directory of flash:/

 1580  -rw-     6462268   Mar 06 2004 06:14:02  c28xx-i-mz.3600ata
    3  -rw-     6458388   Mar 01 2004 00:01:24  c28xx-i-mz

63930368 bytes total (51007488 bytes free)

Entering a Directory: Example

To enter the /config directory:

Router# cd config

To verify that you are in the /config directory:

Router# pwd

flash:/config/

Router# dir

Directory of flash:/config/

  380  -rw-     6462268   Mar 08 2004 06:14:02  myconfig1
  203  -rw-     6458388   Mar 03 2004 00:01:24  myconfig2

63930368 bytes total (51007488 bytes free)

Creating a New Directory

To create a directory in flash memory, enter the mkdir flash: command in privileged EXEC mode.

Creating a New Directory: Example

In the following example, a new directory named "config" is created; then a new subdirectory named "test-config" is created within the "config" directory.

Router# dir flash:

Directory of flash:/

 1580  -rw-     6462268   Mar 06 2004 06:14:02  c28xx-i-mz.3600ata
    3  -rw-     6458388   Mar 01 2004 00:01:24  c28xx-i-mz

63930368 bytes total (51007488 bytes free)
Router# mkdir flash:/config

Create directory filename [config]?
Created dir flash:/config

Router# mkdir flash:/config/test-config

Create directory filename [/config/test-config]?
Created dir flash:/config/test-config

Router# dir flash:

Directory of flash:/

  3  -rw-     6458208   Mar 01 2004 00:04:08  c28xx-i-mz.tmp
 1580  drw-           0   Mar 01 2004 23:48:36  config

128094208 bytes total (121626624 bytes free)

Removing a Directory

To remove a directory in flash memory, enter the rmdir flash: command in privileged EXEC mode.

Before you can remove a directory, you must remove all files and subdirectories from the directory.

Example: Removing a Directory

In the following example, the subdirectory test-config is removed.

Router# dir

Directory of flash:/config/

  1581  drw-           0   Mar 01 2004 23:50:08  test-config

128094208 bytes total (121626624 bytes free)
Router# rmdir flash:/config/test-config

Remove directory filename [/config/test-config]?
Delete flash:/config/test-config? [confirm]
Removed dir flash:/config/test-config
Router# dir

Directory of flash:/config/

No files in directory

128094208 bytes total (121630720 bytes free)

Copyright © 2004 Cisco Systems, Inc. All rights reserved.