Table Of Contents
Working With the Flash File System
Understanding How the Flash File System Works
Working with the Flash File System
Setting the Default Flash Device
Setting the Text File Configuration Mode
Listing the Files on a Flash Device
Copying Files
Deleting Files
Restoring Deleted Files
Verifying a File Checksum
Formatting a Flash Device
Working With the Flash File System
This chapter describes how to use the Flash file system on the Catalyst 6000 family switches.
Note
For complete syntax and usage information for the commands used in this chapter, refer to the Catalyst 6000 Family Command Reference publication.
This chapter consists of these sections:
•
Understanding How the Flash File System Works
•
Working with the Flash File System
Understanding How the Flash File System Works
The Flash file system on a Catalyst 6000 family supervisor engine provides a number of useful commands to help you manage software image and configuration files.
The Flash file system on the supervisor engine consists of two Flash devices on which you can store files:
•
bootflash: onboard Flash memory
•
slot0: Flash PC card in the PCMCIA slot
Working with 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
•
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 switch, 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 switch.
|
cd [[m/][bootflash: | slot0:]]
|
Step 2
|
Verify the default Flash device for the switch.
|
pwd [mod]
|
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 use text file configuration mode, the switch 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 configuration file.
Because the text file only contains commands you have used to configure your switch, it typically uses less NVRAM or Flash memory space than binary configuration mode. Because the text file in most cases requires less space, NVRAM is a good place to store the file. If the text file exceeds NVRAM space, it can also be saved to Flash memory.
When operating in text file configuration mode, most user settings are not immediately saved to NVRAM; configuration changes are only written to DRAM. You will need to enter the write memory command to store the configuration in nonvolatile storage.
Note
VLAN commands are not saved as part of the configuration file when the switch is operating in text mode with the VTP mode set to server.
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
Binary system configuration has been deleted from NVRAM. Configuration
mode set to text. Use the write memory command to save configuration changes.
System configuration file set to: nvram
The nvram file will be used for configuration during the next bootup.
Console> (enable) show config mode
System configuration mode set to text.
System configuration file set to nvram.
Console> (enable) show running-config all
# ***** ALL (DEFAULT and NON-DEFAULT) CONFIGURATION *****
#time: Wed Jul 18 2001, 06:51:56
set password $2$FMFQ$HfZR5DUszVHIRhrz4h6V70
set enablepass $2$FMFQ$HfZR5DUszVHIRhrz4h6V70
set config mode text nvram
set test diaglevel complete
set errordetection inband disable
set errordetection memory disable
set errordetection portcounter enable
----display truncated------
Listing the Files on a Flash Device
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 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 Mar 15 1999 08:27:01 cat6000-sup.5-2-1-CSX.bin
5 3231989 Jan 24 1999 12:04:40 cat6000-sup.5-1-1-CSX.bin
6 135 Feb 17 1999 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 cat6000-sup.5-2-1-CSX.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 6000_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)
Copying Files
To copy a file, perform one of these tasks in privileged mode:
Task
|
Command
|
Copy a Flash file to a TFTP server, rcp 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, rcp 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, rcp 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, to a TFTP server, or rcp 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 cat6000-sup.5-2-1-CSX.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 []? 6000_config.cfg
Upload configuration to slot0:6000_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:6000_config.cfg tftp
IP address or name of remote host []? 172.20.52.3
Name of file to copy to [6000_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 []? 6000_config.cfg
Flash device [bootflash]?
Name of file to copy to [6000_config.cfg]?
4369664 bytes available on device bootflash, proceed (y/n) [n]? y
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
File has been copied successfully.
Deleting Files
Caution 
If you enter the
squeeze command on a Flash device, you cannot restore files deleted prior to 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
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.
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 cat6000-sup.5-2-1.bin
5 3231989 Jun 24 1998 12:04:40 cat6000-sup.5-2-1.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 cat6000-sup.5-2-1-CSX.bin
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
File bootflash:cat6000-sup.5-2-1-CSX.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 Supervisor Engine 1 or on a route-switch processor (RSP)-based Cisco 7500 series router are interchangeable if 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 software 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 switch formats the device using the monlib file that is bundled with the software. If you omit just the device name (device2) from the [[device2:][monlib-filename]] argument, the switch 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 switch formats the device using the monlib file from device2. If you specify the entire [[device2:][monlib-filename]] argument, the switch formats the device using the specified monlib file from the specified device. If the switch cannot find a monlib file, it terminates the formatting process.
Note
If the Flash device has a volume ID, you must provide the volume ID to format the device. The volume ID is displayed using the show flash m/device: filesys command.
To format a Flash device, perform this task in privileged mode:
Task
|
Command
|
Format a Flash device.
|
format [spare spare-number] [m/]device1: [[device2:] [monlib-filename]]
|
This example shows how to format the Flash device in slot0:
Console> (enable) format slot0:
All sectors will be erased, proceed (y/n) [n]?y
Enter volume id (up to 31 characters):
Format device slot0 completed.
Note
Supervisor Engine 2 and Supervisor Engine 1 do not support the same Flash PC card format. To use a Flash PC card with Supervisor Engine 2, format the card with Supervisor Engine 2. To use a Flash PC card with Supervisor Engine 1, format the card with Supervisor Engine 1.