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

Table of Contents

Working With the Flash File System

Working With 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 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.

The Flash file system on the Supervisor Engine III, the RSM, and the Catalyst 2926G series switches consists of three Flash devices on which you can store system files:

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


Note Throughout this publication, the term Flash PC card is used in place of the term PCMCIA card.

Working with 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

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)

Copying Files


Note The Flash file system copy command replaces the download, upload, configure network, and write network commands used on the Supervisor Engine II.

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 | 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 {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 | file-id | config}

  • Copy the running configuration to Flash memory, another Flash device, or to a TFTP server.

copy config {flash | file-id | tftp}

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)

Deleting Files

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)

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
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: Mon Jul 19 13:03:04 PDT 1999
Copyright 1989-1999©Cisco Systems Inc.