Table Of Contents
Using the Flash File System
Understanding How the Flash File System Works
Using the Flash File System
Setting the Default Flash Device
Setting the Text File Configuration Mode
Listing the Files on a Flash Device
Displaying the Contents of a File on a Flash Device
Copying Files
Deleting Files
Restoring Deleted Files
Verifying a File Checksum
Formatting a Flash Device
Using the Flash File System
This chapter describes how to how to use the Flash file system.
Note
For complete syntax and usage information for the commands used in this chapter, refer to the Catalyst 5000 Family Command Reference.
This chapter consists of these sections:
•
Understanding How the Flash File System Works
•
Using the Flash File System
Understanding How the Flash File System Works
The Flash file system provides a number of useful commands to help you manage system image and configuration files.
On the Supervisor Engine III, the Flash file system consists of three Flash devices on which you can store system files:
•
bootflash:—Onboard Flash memory
•
slot0:—First (bottom) PC card (PCMCIA) slot
•
slot1:—Second (top) PC card slot
On the Supervisor Engine II G and III G, a limited Flash file system is implemented in software release 5.2 and later. Up to two configuration files, cfg1 and cfg2, can be stored in Flash memory. Each configuration file can be up to 256 KB.
Using the Flash File System
These sections describe how to work with the Flash file system:
•
Setting the Default Flash Device
•
Setting the Text File Configuration Mode
•
Listing the Files on a Flash Device
•
Displaying the Contents of a File on a Flash Device
•
Copying Files
•
Deleting Files
•
Restoring Deleted Files
•
Verifying a File Checksum
•
Formatting a Flash Device
Setting the Default Flash Device
When you set the default Flash device for the system, the default device is assumed when you enter a Flash file system command without specifying the Flash device.
To set the default Flash device, perform this task:
|
Task
|
Command
|
Step 1
|
Set the default Flash device for the system.
|
cd [[m/][bootflash: | slot0: | slot1:]]
|
Step 2
|
Verify the default Flash device for the system.
|
pwd [mod_num]
|
This example shows how to change the default Flash device to slot0: and verify the default device:
Console> (enable) cd slot0:
Setting the Text File Configuration Mode
When you configure the system to use the text file configuration mode, the system stores its configuration as a text file in nonvolatile storage, either in NVRAM or Flash memory. This text file consists of commands entered by you to configure various features. For example, if you disable a port, the command to disable that port will be in the text file configuration.
Because the text file only contains commands you have used to configure your switch, the file typically uses less NVRAM or Flash memory space than the binary configuration mode. NVRAM is usually the best location for the text file to be stored. If the text file exceeds NVRAM space, you can also store it to Flash memory.
When operating in text file configuration mode, most user settings are not immediately saved to NVRAM. Configuration changes are written only to DRAM. To store the configuration in nonvolatile storage, you need to enter the write memory command.
To set the text file configuration mode, perform this task:
|
Task
|
Command
|
Step 1
|
Set the file configuration mode for the system to text.
|
set config mode {binary | text} [nvram | device:file-id]
|
Step 2
|
Verify the file configuration mode for the system.
|
show config mode
|
Step 3
|
Save the text file configuration.
|
write memory
|
Step 4
|
Display the current runtime configuration.
|
show running-config all
|
Step 5
|
Display the startup configuration that will be used after the next reset.
|
show config
|
This example shows how to configure the system to save its configuration as a text file in NVRAM, verify the configuration mode, and display the current runtime configuration:
Console> (enable) set config mode text nvram
Console> (enable) show config mode
Console> (enable) show running-config all
Console> (enable) show config
Listing the Files on a Flash Device
Catalyst 5000 Family Supervisor Engine III
To list the files on a Flash device, perform one of these tasks:
Task
|
Command
|
Display a list of files on a Flash device.
|
dir [[m/]device:][filename]
|
Display a list of only deleted files on a Flash device.
|
dir [[m/]device:][filename] deleted
|
Display a list of all files on a Flash device, including deleted files.
|
dir [[m/]device:][filename] all
|
Display a detailed list of files on a Flash device.
|
dir [[m/]device:][filename] long
|
This example shows how to list the files on the default Flash device:
-#- -length- -----date/time------ name
4 3134688 Apr 27 1998 08:27:01 cat5000-sup3.4-1-0-66.bin
5 3231989 Jun 24 1998 12:04:40 cat5000-sup3.4-2-0-28.bin
6 135 Jul 17 1998 11:30:05 dns_config.cfg
1213952 bytes available (6388224 bytes used)
This example shows how to list the files on a Flash device other than the default device:
Console> (enable) dir slot0:
-#- -length- -----date/time------ name
1 3209261 Jun 16 1998 13:18:19 cat5000-sup3.4-2-1.bin
2 135 Jul 17 1998 11:32:53 dns-config.cfg
3 3231989 Jul 17 1998 16:54:23 cat5000-sup3.4-1-2.bin
4 8589 Jul 17 1998 17:02:52 5000_config.cfg
9933504 bytes available (6450496 bytes used)
This example shows how to list the deleted files on the default Flash device:
Console> (enable) dir deleted
-#- ED --type-- --crc--- -seek-- nlen -length- -----date/time------ name
1 .D ffffffff 81a027ca 41bdc 22 7004 Apr 01 1998 15:27:45 5002.config.
2 .D ffffffff ccce97a3 43644 23 6630 Apr 01 1998 15:36:47 5002.default
3 .D ffffffff 81a027ca 45220 15 7004 Apr 19 1998 10:05:59 5002_config.
1213952 bytes available (6388224 bytes used)
Catalyst 5000 Family Supervisor Engine II G and III G
To list the configuration files stored in Flash, perform this task:
Task
|
Command
|
Display the configuration files stored in Flash.
|
show flash
|
This example shows how to list the configuration files stored in Flash:
Console> (enable) show flash
--------------- -------------------- ------- -----------------
c5000 nmp 5.2(1) 2893903 09/06/99 12:09:31
lcp 5.2(1) 26116 09/06/99 11:51:47
lcp 360 5.2(1) 140468 09/06/99 11:58:12
atm/fddi 5.2(1) 26584 09/06/99 11:51:49
lcp 64k 5.2(1) 58165 09/06/99 11:56:56
lcp c5ip 5.2(1) 25858 09/06/99 11:56:59
lcp tr 5.2(1) 32480 09/06/99 11:52:42
mcp 360 5.2(1) 252668 09/06/99 12:03:54
lcp atm 5.2(1) 26557 09/06/99 12:03:56
lcp xa1 5.2(1) 89100 09/06/99 12:00:54
lcp xa2 5.2(1) 58806 09/06/99 12:03:21
mcp3g 5.2(1) 61774 09/06/99 11:48:29
mcp2g 5.2(1) 57085 09/06/99 11:43:51
mcp2g s4a 5.2(1) 61244 09/06/99 11:38:57
mcp2g s4b 32744 09/06/99 11:38:57
cfg1 135 09/09/99 15:02:41
cfg2 4501 09/11/99 14:18:21
Displaying the Contents of a File on a Flash Device
In software release 5.2 and later, you can display the contents of a file on a Flash device onscreen. Use the dump keyword to display a hex dump of the file.
Catalyst 5000 Family Supervisor Engine III Switches
To display the contents of a file on a Flash device, perform this task in privileged mode:
Task
|
Command
|
Display the contents of a file on a Flash device.
|
show file [device:]filename [dump]
|
This example shows how to display the contents of a file on a Flash device on a Catalyst 5000 family switch with Supervisor Engine III:
Console> (enable) show file bootflash:dns_config.cfg
set ip dns server 172.16.10.70 primary
set ip dns server 172.16.10.140
set ip dns domain corp.com
Catalyst 5000 Family Supervisor Engine II G and III G
To display the contents of the startup configuration files on a Supervisor Engine II G or III G, perform this task in privileged mode:
Task
|
Command
|
Display the contents of a startup configuration file on a Supervisor Engine II G or III G.
|
show file {cfg1 | cfg2} [dump]
|
This example shows how to display the contents of a startup configuration file on a Supervisor Engine II G or III G:
Console> (enable) show file cfg1
set ip dns server 172.16.10.70 primary
set ip dns server 172.16.10.140
set ip dns domain corp.com
Copying Files
Use the copy command to perform these tasks:
•
Download a system image or configuration file from a TFTP or rcp server to a Flash device
•
Upload a system image or configuration file from a Flash device to a TFTP or rcp server
•
Configure the switch using a configuration file on a Flash device or on a TFTP or rcp server
•
Copy the current configuration to a Flash device or to a TFTP or rcp server
Catalyst 5000 Family Supervisor Engine III Switches
To copy a file, perform one of these tasks in privileged mode:
Task
|
Command
|
Copy a Flash file to a TFTP server, Flash memory, another Flash device, or to the running configuration.
|
copy file-id {tftp | rcp | flash | file-id | config}
|
Copy a file from a TFTP server to Flash memory, to a Flash device, or to the running configuration.
|
copy {tftp | rcp} {flash | file-id | config}
|
Copy a file from Flash memory to a TFTP server, to a Flash device, or to the running configuration.
|
copy flash {tftp | rcp | file-id | config}
|
Copy the running configuration to Flash memory, another Flash device, or to a TFTP server.
|
copy config {flash | file-id | tftp | rcp}
|
This example shows how to copy a file from the default Flash device to another Flash device:
Console> (enable) copy cat5000-sup3.4-2-1.bin slot0:
13174216 bytes available on device slot0, proceed (y/n) [n]? y
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
ccccccccccccCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
File has been copied successfully.
This example shows how to copy a file from a TFTP server to the running configuration:
Console> (enable) copy tftp config
IP address or name of remote host []? 172.20.52.3
Name of file to copy from []? dns_config.cfg
Configure using tftp:dns_config.cfg (y/n) [n]? y
Finished network download. (135 bytes)
>> set ip dns server 172.16.10.70 primary
172.16.10.70 added to DNS server table as primary server.
>> set ip dns server 172.16.10.140
172.16.10.140 added to DNS server table as backup server.
>> set ip dns domain corp.com
Default DNS domain name set to corp.com
This example shows how to download a configuration file from a TFTP server for storage on a Flash device:
Console> (enable) copy tftp flash
IP address or name of remote host []? 172.20.52.3
Name of file to copy from []? dns-config.cfg
Name of file to copy to [dns-config.cfg]?
9932056 bytes available on device slot0, proceed (y/n) [n]? y
File has been copied successfully.
This example shows how to copy the running configuration to Flash memory:
Console> (enable) copy config flash
Flash device [bootflash]? slot0:
Name of file to copy to []? 5000_config.cfg
Upload configuration to slot0:5000_config.cfg
9942096 bytes available on device slot0, proceed (y/n) [n]? y
Configuration has been copied successfully.
This example shows how to upload a configuration file on a Flash device to a TFTP server:
Console> (enable) copy slot0:5000_config.cfg tftp
IP address or name of remote host []? 172.20.52.3
Name of file to copy to [5000_config.cfg]?
File has been copied successfully.
This example shows how to upload an image from a remote host into Flash using rcp:
Console> (enable) copy rcp flash
IP address or name of remote host []? 172.20.52.3
Name of file to copy from []? cat5000-sup3.4-2-1.bin
Flash device [bootflash]?
Name of file to copy to [cat5000-sup3.4-2-1.bin]?
4369664 bytes available on device bootflash, proceed (y/n) [n]? y
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
File has been copied successfully.
Catalyst 5000 Family Supervisor Engine II G and III G
To copy a file, perform one of these tasks in privileged mode:
Task
|
Command
|
Copy the running configuration or a configuration file from a TFTP server to Flash.
|
copy {tftp | rcp | config} {cfg1 | cfg2}
|
Copy a configuration file from Flash to a TFTP server or to the running configuration.
|
copy {cfg1 | cfg2} {tftp | rcp | config}
|
This example shows how to copy a configuration file from a TFTP server to Flash:
Console> (enable) copy tftp cfg1
IP address or name of remote host [172.20.52.3]? 172.20.52.10
Name of file to copy from [cfg1]? dns_config.cfg
Erasing flash sector...done.
Programming flash sector...done.
This example shows how to copy a configuration file from Flash to a TFTP server:
Console> (enable) copy cfg1 tftp
IP address or name of remote host [172.20.52.3]? 172.20.52.10
Name of file to copy to [cfg1]? dns_config.cfg
Upload cfg1 to dns_config.cfg on 172.20.52.10 (y/n) [n]? y
Finished network upload. (4644 bytes)
This example shows how to copy the running configuration to Flash:
Console> (enable) copy config cfg1
Upload configuration to flash cfg1 (y/n) [n]? y
Erasing flash sector...done.
Programming flash sector...done.
Configuration has been copied successfully.
This example shows how to copy a configuration file in Flash to the running configuration:
Console> (enable) copy cfg2 config
Configure using flash cfg2 (y/n) [n]? y
Finished network download. (135 bytes)
>> set ip dns server 172.16.10.70 primary
172.16.10.70 added to DNS server table as primary server.
>> set ip dns server 172.16.10.140
172.16.10.140 added to DNS server table as backup server.
>> set ip dns domain corp.com
Default DNS domain name set to corp.com
Deleting Files
Use the delete command to delete files on a Flash device.
Catalyst 5000 Family Supervisor Engine III Switches
Caution 
If you enter the
squeeze command on a Flash device, you cannot restore files that you deleted on that device before you entered the
squeeze command.
To delete files on a Flash device, perform this task in privileged mode:
|
Task
|
Command
|
Step 1
|
Delete a file on a Flash device.
|
delete [[m/]device:]filename
|
Step 2
|
If desired, permanently remove all deleted files on the Flash device (this operation can take a number of minutes to complete).
|
squeeze [m/]device:
|
Step 3
|
Verify the files are deleted.
|
dir [[m/]device:][filename]
|
This example shows how to delete a file from a Flash device:
Console> (enable) delete dns_config.cfg
This example shows how to permanently remove all deleted files from a Flash device:
Console> (enable) squeeze slot0:
All deleted files will be removed, proceed (y/n) [n]? y
Squeeze operation may take a while, proceed (y/n) [n]? y
Catalyst 5000 Family Supervisor Engine II G and III G
To delete a configuration file on the Catalyst 5000 family Supervisor Engine II G or III G, perform this task in privileged mode:
|
Task
|
Command
|
Step 1
|
Delete a configuration file on the Catalyst 5000 family Supervisor Engine II G or III G.
|
delete {cfg1 | cfg2}
|
Step 2
|
Verify the files are deleted.
|
show flash
|
This example shows how to delete a configuration file on the Catalyst 5000 family Supervisor Engine II G or III G:
Console> (enable) delete cfg1
Delete cfg1 from flash (y/n) [n]? y
cfg1 has been deleted from flash.
Restoring Deleted Files
You must specify the index number of a deleted file to identify the file to undelete. The index number for each file appears in the first column of the dir command output. A file cannot be undeleted if a valid file with the same name already exists. Instead, you must delete the existing file and then undelete the desired file. A file can be deleted and undeleted up to 15 times.
Note
You cannot restore a deleted configuration file on the Catalyst 5000 family Supervisor Engine II G or III G.
To restore deleted files on a Flash device, perform this task in privileged mode:
|
Task
|
Command
|
Step 1
|
Identify the index number of the deleted files on the Flash device.
|
dir [[m/]device:][filename] deleted
|
Step 2
|
Undelete a file on a Flash device.
|
undelete index [[m/]device:]
|
Step 3
|
Verify that the file is restored.
|
dir [[m/]device:][filename]
|
This example shows how to restore a deleted file:
Console> (enable) dir deleted
-#- ED --type-- --crc--- -seek-- nlen -length- -----date/time------ name
6 .D ffffffff 42da7f71 657a00 14 135 Jul 17 1998 11:30:05 dns_config.cfg
1213952 bytes available (6388224 bytes used)
Console> (enable) undelete 6
-#- -length- -----date/time------ name
4 3134688 Apr 27 1998 08:27:01 cat5000-sup3.4-1-0-66.bin
5 3231989 Jun 24 1998 12:04:40 cat5000-sup3.4-2-0-28.bin
6 135 Jul 17 1998 11:30:05 dns_config.cfg
1213952 bytes available (6388224 bytes used)
Verifying a File Checksum
To verify the checksum of a file on a Flash device, perform this task in privileged mode:
Task
|
Command
|
Verify the checksum of a file on a Flash device.
|
verify [[m/]device:] filename
|
This example shows how to verify the checksum of a file:
Console> (enable) verify cat5000-sup3.4-2-1.bin
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
File bootflash:cat5000-sup3.4-2-1.bin verified OK
Formatting a Flash Device
Before you use a new Flash device, you must format it. You can reserve up to 16 spare sectors for use when other sectors fail (by default, none are reserved). If you do not reserve spare sectors and later some sectors fail, you will have to reformat the entire Flash memory, erasing all existing data.
Note
Flash PC cards formatted on the Supervisor Engine III or on a Route Switch Processor (RSP)-based Cisco 7500 series router are interchangeable provided the router is running software at least at the same level as the supervisor engine. You cannot use Flash PC cards formatted on a Route Processor (RP)-based Cisco 7000 series router without reformatting.
When you format a Flash device, you can specify the monlib file (the ROM monitor library), which the ROM monitor uses to access files in the Flash file system. The monlib file is also compiled into the system image.
In the format command syntax, use the device2 argument to specify the device that contains the monlib file to use. If you omit the entire device2 argument, the system formats the device using the monlib file that is bundled with the system software.
If you omit just the device name (device2) from the [[device2:][monlib-filename]] argument, the system formats the device using the named monlib file from the default Flash device. If you omit the monlib-filename from the [[device2:][monlib-filename]] argument, the system formats the device using the monlib file from device2.
If you specify the entire [[device2:][monlib-filename]] argument, the system formats the device using the specified monlib file from the specified device. If the system cannot find a monlib file, it terminates the formatting process.
To format a Flash memory device, perform this task in privileged mode:
Task
|
Command
|
Format a Flash memory device.
|
format [spare spare-number] [m/]device1: [[device2:] [monlib-filename]]
|
This example shows how to format the Flash device in slot 1:
Console> (enable) format slot1:
All sectors will be erased, proceed (y/n) [n]?y
Enter volume id (up to 31 characters):
Format device slot1 completed.