Using CompactFlash Memory
First Published: May 27, 2010, OL-20356-01
Last Updated: October 25, 2017
The Cisco Connected Grid Router 2010 uses Advanced Capability CF external memory to store the system image, configuration files, and some software data files. CF supports true integrated development environment mode and multi-word direct memory access mode.
This document explains how to manage directories and files on the CF in the following sections:
Requirements and Restrictions
CompactFlash Support
- Only Advanced Capability CF purchased from Cisco operate in the Cisco CGR 2010 router.
- Legacy CF will not operate in Cisco CGR 2010 router. When legacy CF is inserted, the following error message appears:
WARNING: Unsupported compact flash detected. Use of this card during normal operation can impact and severely degrade performance of the system. Please use supported compact flash cards only.
Formatting CompactFlash
- Only Class C file systems are supported on Cisco PCMCIA CompactFlash (CF).
- We recommend that you format new CF to initialize a new flash file system. Proper formatting lets the ROM monitor recognize and boot the flash memory. The CF can be formatted on a router, and files 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, use the Microsoft File Allocation Table (FAT32) file system.
CompactFlash Slots and Files
- Cisco CGR 2010 routers have two types of external CF slots
– 2— PCMCIA
– 2— USB
- CF in slot0 can store the system image, configuration, and data files. The CF must be present in this slot for the router to boot and perform normal file operations.
Note Use flash1 in the command syntax to access CF in slot 1. Use flash0 in the command syntax to access CF in slot 0.
Table 1 Compact Flash Slot Numbering and Naming
|
|
|
|
Slot0 |
flash0 |
usbflash0 |
256MB |
Slot1 |
flash1 |
usbflash1 |
0 |
Total |
- |
- |
4GB |
Online Insertion and Removal
Online insertion and removal (OIR) is a feature that allows you to replace CompactFlash 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 blinking, 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 router’s Hardware Installation Guide.
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
Note Use flash1 in the command syntax to access CF in slot 1. Use flash0 in the command syntax to access CF in slot 0.
Formatting CompactFlash Memory as a Class C Flash File System: Example
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..................................................................
Format:All system sectors written. OK...
Format:Total sectors in formatted partition:250592
Format:Total bytes in formatted partition:128303104
Format:Operation completed successfully.
File Operations on CompactFlash Memory Cards
This section describes the following file operations for external CF memory cards:
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.
Note Use flash1 in the command syntax to access CF in slot 1. Use flash0 in the command syntax to access CF in slot 0.
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]?
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 in CF memory, enter the dir flash: command in privileged EXEC mode.
Note Use flash1 in the command syntax to access CF in slot 1. Use flash0 in the command syntax to access CF in slot 0.
1580 -rw- 6462268 Mar 06 2004 06:14:02 c29xx-i-mz.3600ata
3 -rw- 6458388 Mar 01 2004 00:01:24 c29xx-i-mz
63930368 bytes total (51007488 bytes free)
Displaying CF Platform Support Status and Errors
To display the platform support status of the CF memory, enter the show platform cf command in privileged EXEC mode.
Platform Support status of Compact Flash:
===========================================
CF flash0: Compact Flash plugged in is Unsupported
CF flash1: Compact Flash not plugged in.
To display platform error status, enter the show platform error command in privileged EXEC mode.
Router# show platform error
Interface GigabitEthernet0/0:
----------------------------
Unknown Protocol Drops : 6
Interface GigabitEthernet0/1:
----------------------------
Compact Flash 0 Unsupported (HT)
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:
Note Use flash1 in the command syntax to access CF in slot 1. Use flash0 in the command syntax to access CF in slot 0.
Router# more flash:cgr2010-universalk9-mz.SPA.151-1.T
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, <...
Displaying Geometry and Format Information
To display the geometry and format information of a CF flash file system, enter the show flash: filesys command in privileged EXEC mode.
Note Use flash1 in the command syntax to access CF in slot 1. Use flash0 in the command syntax to access CF in slot 0.
Router# show flash0 filesys
******** ATA Flash Card Geometry/Format Info ********
Model Number SMART CF fs:8000
Serial Number 2009101509D809B20000
Firmware Revision 20060729
Number of Sectors 2001825
Number of FAT Sectors 245
Number of Data Sectors 2001280
Deleting Files
To delete a file from a CF memory card, enter the delete flash: command.
Note Use flash1 in the command syntax to access CF in slot 1. Use flash0 in the command syntax to access CF in slot 0.
Note The dir flash: command does not display deleted files and files with errors.
Renaming Files
To rename a file on a CF memory card, enter the rename command in privileged EXEC mode.
Note Use flash1 in the command syntax to access CF in slot 1. Use flash0 in the command syntax to access CF in slot 0.
3 -rw- 6458388 Mar 01 2009 00:00:58 cgr2010-universalk9-mz.tmp
1580 -rw- 6462268 Mar 06 2009 06:14:02 cgr2010-universalk9-mz.3600ata
63930368 bytes total (51007488 bytes free)
Router# rename flash:cgr2010-universalk9-mz.SPA.151-1.T.tmp flash:cgr2010-universalk9-mz
Destination filename [cgr2010-universalk9-mz]?
1580 -rw- 6462268 Mar 06 2009 06:14:02 cgr2010-universalk9-mz.3600ata
3 -rw- 6458388 Mar 01 2009 00:01:24 cgr2010-universalk9-mz
63930368 bytes total (51007488 bytes free)
Directory Operations on a CompactFlash Memory Card
The following sections describe directory operations for external CF memory cards on Cisco routers:
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 flash0. If you enter cd flash1 or cd usbflash1, the router enters the flash1 directory.
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.
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.
1580 -rw- 6462268 Mar 06 2009 06:14:02 cgr2010-universalk9-mz.3600ata
3 -rw- 6458388 Mar 01 2009 00:01:24 cgr2010-universalk9-mz
63930368 bytes total (51007488 bytes free)
Entering a Directory: Example
To enter the /config directory:
To verify that you are in the /config directory:
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.
Note Use flash1 in the command syntax to access CF in slot 1. Use flash0 in the command syntax to access CF in slot 0.
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.
1580 -rw- 6462268 Mar 06 2009 06:14:02 cgr2010-universalk9-mz.3600ata
3 -rw- 6458388 Mar 01 2009 00:01:24 cgr2010-universalk9-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
3 -rw- 6458388 Mar 01 2009 00:01:24 cgr2010-universalk9-mz
1580 drw- 0 Mar 01 2004 23:48:36 config
63930368 bytes total (51007488 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.
Note Use flash1 in the command syntax to access CF in slot 1. Use flash0 in the command syntax to access CF in slot 0.
Example: Removing a Directory
In the following example, the subdirectory test-config is removed.
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
Directory of flash:/config/
128094208 bytes total (121630720 bytes free)