cc/td/doc/product/lan/cat5000/rel_5_2
hometocprevnextglossaryfeedbacksearchhelp
PDF

Table of Contents

Using the Flash File System

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 Command Reference publication for your switch.

This chapter consists of these sections:

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 and the Catalyst 2926G series switches, the Flash file system consists of three Flash devices on which you can store system files:

On the Supervisor Engine III F, and on the Catalyst 4000 family and 2948G switches, there is only one flash device, bootflash:.

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 in size.

Using the Flash File System

These sections describe how to work with the Flash file system:

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:
Console> (enable) pwd
slot0
Console> (enable)

Listing the Files on a Flash Device

Catalyst 5000 Family Supervisor Engine III and III F, Catalyst 4000 Family, 2926G Series, and 2948G Switches

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:

Console> (enable) dir
-#- -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)
Console> (enable)
 
 

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)
Console> (enable)
 
 

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.
4.1.98.cfg
  2 .D ffffffff ccce97a3   43644   23     6630 Apr 01 1998 15:36:47 5002.default
.config.cfg
  3 .D ffffffff 81a027ca   45220   15     7004 Apr 19 1998 10:05:59 5002_config.
cfg
 
1213952 bytes available (6388224 bytes used)
Console> (enable)
Catalyst 5000 Family Supervisor EngineIIG and IIIG

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 
File            Version              Size    Built
--------------- -------------------- ------- -----------------
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
      trembl    c6.30(ff.ff)            9216 
      trembl2   6.30(4.1)               9216 
      banff     3.ff(ff.ff)             9216 
      banff2    6.7(0.f)                9216 
cfg1                                     135 09/09/99 15:02:41
cfg2                                    4501 09/11/99 14:18:21
Console> (enable)

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 and III F, Catalyst 4000 Family, 2926G Series, and 2948G 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
begin
 
!
#dns
set ip dns server 172.16.10.70 primary
set ip dns server 172.16.10.140
set ip dns enable
set ip dns domain corp.com
end
Console> (enable)
Catalyst 5000 Family Supervisor EngineIIG and IIIG

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
begin
 
!
#dns
set ip dns server 172.16.10.70 primary
set ip dns server 172.16.10.140
set ip dns enable
set ip dns domain corp.com
end
Console> (enable) 

Copying Files

Use the copy command to perform these tasks:

Catalyst 5000 Family Supervisor Engine III and III F, Catalyst 4000 Family, 2926G Series, and 2948G 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.
Console> (enable)
 
 

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 enable
DNS is enabled
>> set ip dns domain corp.com
Default DNS domain name set to corp.com
Console> (enable)
 
 

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
Flash device [slot0]?
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.
Console> (enable)
 
 

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.
Console> (enable)
 
 

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.
Console> (enable)
 

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
CCCCCCCCCCCCCCCCCCC
File has been copied successfully.
Console> (enable) 
 
 
Catalyst 5000 Family Supervisor EngineIIG and IIIG

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.
Console> (enable) 
 
 

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)
Console> (enable) 
 
 

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.
Console> (enable) 
 
 

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 enable
DNS is enabled
>> set ip dns domain corp.com
Default DNS domain name set to corp.com
Console> (enable) 

Deleting Files

Use the delete command to delete files on a Flash device.

Catalyst 5000 Family Supervisor Engine III and III F, Catalyst 4000 Family, 2926G Series, and 2948G 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
Console> (enable)
 

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
Erasing squeeze log
Console> (enable)
Catalyst 5000 Family Supervisor EngineIIG and IIIG

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
Erasing flash sector...
cfg1 has been deleted from flash.
Console> (enable)

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
Console> (enable) dir
-#- -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)
Console> (enable)

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
CCCCCCCCCCCCCCC
File bootflash:cat5000-sup3.4-2-1.bin verified OK
Console> (enable)

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 slot1:

Console> (enable) format slot1:
All sectors will be erased, proceed (y/n) [n]?y
Enter volume id (up to 31 characters):
Formatting sector 1
Format device slot1 completed.
Console> (enable) 
 


hometocprevnextglossaryfeedbacksearchhelp
Posted: Fri Oct 1 13:23:16 PDT 1999
Copyright 1989-1999©Cisco Systems Inc.