|
|
This chapter describes the Flash commands used in the Catalyst 5000 series switch CLI for the Supervisor Engine III. For a summary of the available switch CLI commands, refer to the "Switch Command Quick Reference" chapter. For more information about using the switch CLI, refer to the "Switch Command-Line Interface" chapter.
Use the cd command to set the default Flash device for the system.
cd [[m/]device:]| m/ | (Optional) Module number of the supervisor engine containing the Flash device. |
| device: | (Optional) Valid devices include bootflash, slot0, and slot1. |
The default Flash device is bootflash.
Flash command.
Privileged.
A colon (:) is required after the specified device.
For those commands where device is an option, the device set by cd is used if the default device is not specified.
This example shows how to set the system default Flash device to bootflash:
Console> cd bootflash: Default flash device set to bootflash.
Use the copy command to upload or download a Flash image or a switch configuration to or from a Flash device or a TFTP server.
copy file-id {tftp | flash | file-id | config}| file-id | Format used to specify the file on the Flash device, where the format is m/device:filename.
m/ = Option that gives access to different modules, such as the standby supervisor engine, an FDDI module, and an ATM module. device: = Device where the Flash resides. filename = Name of the configuration file. |
| tftp | Keyword that allows you to copy to or from a TFTP server. |
| flash | Keyword used to support multiple module download. |
| config | Keyword that allows you to copy the configuration to Flash memory, another Flash device, or a file on a TFTP server. |
If a source or destination device is not given, the one specified by the cd command is used. If a destination filename is omitted, the source filename is used.
Flash command.
Privileged.
If copying to an FDDI or ATM module, you must specify the file-id as m/bootflash: without the filename.
If the source or destination device is not specified, the command uses the ones specified by the cd command. If the destination filename is omitted, the software uses the source filename.
A colon (:) is required after the specified device.
When the flash keyword is used, based on the file type derived, a prompt is given for all modules of the same type. A different prompt is given depending on the command argument and reply.
ATM module software release 4.3(0) does not support the copy tftp command. Use the write network or the config network command to save or retrieve the configuration to a TFTP server.
The following example shows how to use the copy command to upload the switch configuration to a file named cat.cfg on the slot0 Flash device:
Console> (enable) copy config slot0:cat.cfg Upload configuration to slot0:cat.cfg 649324 bytes available on device slot0, proceed (y/n) [n]? y ......... ......... ......... ........ ......... . / Configuration has been copied successfully. (10200 bytes) Console> (enable)
The following example shows how to use the copy command to upload the switch configuration to a file named lab2.cfg on the TFTP server:
Console> (enable) copy config tftp:lab2.cfg IP address or name of remote host [172.20.22.7]? y Upload configuration to tftp:lab2.cfg (y/n) [n]? y ......... ......... ......... . / Configuration has been copied successfully. (10299 bytes). Console> (enable)
The following example shows how to use the copy command to upload the switch configuration to the cat.cfg file on the slot1 Flash device:
Console> (enable) copy config flash Flash device [bootflash]? slot1: Name of file to copy to [test_image]? cat.cfg Upload configuration to slot1:cat.cfg 749124 bytes available on device slot1, proceed (y/n) [n]? y ......... ......... ......... ........ . / Configuration has been copied successfully. (200345 bytes). Console> (enable)
The following examples show how to use the copy commands to download a configuration:
Console> (enable) copy slot0:cat.cfg config Configure using slot0:cat.cfg (y/n) [n]? y / Finished download. (10900 bytes) >> set password $1$FMFQ$HfZR5DUszVHIRhrz4h6V70 Password changed. >> set enablepass $1$FMFQ$HfZR5DUszVHIRhrz4h6V70 Password changed. >> set prompt Console> >> set length 24 default Screen length set to 24. >> set logout 20 .......... Console> (enable) Console> (enable) copy tftp config IP address or name of remote host? 172.20.22.7 Name of configuration file? cat.cfg Configure using cat.cfg from 172.20.22.7 (y/n) [n]? y / Finished network download. (10900 bytes) >> set password $1$FMFQ$HfZR5DUszVHIRhrz4h6V70 Password changed. >> set enablepass $1$FMFQ$HfZR5DUszVHIRhrz4h6V70 Password changed. >> set prompt Console> >> set length 24 default Screen length set to 24. >> set logout 20 ........... Console> (enable) Console> (enable) copy flash config Flash device [bootflash]? Name of configuration file? test.cfg Configure using bootflash:test.cfg (y/n) [n]? y / Finished download. (10900 bytes) >> set password $1$FMFQ$HfZR5DUszVHIRhrz4h6V70 Password changed. >> set enablepass $1$FMFQ$HfZR5DUszVHIRhrz4h6V70 Password changed. >> set prompt Console> >> set length 24 default Screen length set to 24. >> set logout 20 ..... Console> (enable)
write network
configure network
Use the delete command to delete a configuration file.
delete [[m/]device:]filename| m/ | (Optional) Module number of the supervisor engine containing the Flash device. |
| device: | (Optional) Device where the Flash resides. |
| filename | Name of the configuration file. |
This command has no default setting.
Flash command.
Privileged.
A colon (:) is required after the specified device.
This example shows how to delete the cat5000-sup3.3-1-1.bin configuration file from the Flash device and then check using the show flash command:
Console> (enable) delete bootflash:cat5000-sup3.3-1-1.bin Console> (enable) Console> (enable) show flash -#- ED --type-- --crc--- -seek-- nlen -length- -----date/time------ name 1 .D ffffffff 5415406e 3300b8 25 3080247 Mar 12 1998 13:22:46 cat5000-sup3 .3-1-1.bin 2 .. ffffffff 762950d6 6234d0 25 3093399 Mar 20 1998 12:33:14 cat5000-sup3 .4-1-1.bin 1428272 bytes available (6173904 bytes used) Console> (enable)
Use the dir command to display a list of files on a Flash memory device.
dir [[m/]device:][filename] [all | deleted | long]| m/ | (Optional) Module number of the supervisor engine containing the Flash device. |
| device: | (Optional) Device where the Flash resides. |
| filename | (Optional) Name of the configuration file. |
| all | (Optional) Keyword that displays all files, deleted or not. |
| deleted | (Optional) Keyword that displays only deleted files. |
| long | (Optional) Keyword that displays files that have not been deleted, in long format. |
This command has no default setting.
Flash command.
Normal and privileged.
A colon (:) is required after the specified device.
When you specify the all keyword, the file information is displayed in long format.
When you omit all keywords (all, deleted, or long), the system displays file information in short format. Short format is shown in Table 4-1:
| Column Heading | Description |
|---|---|
| # | File index number |
| length | File length |
| date/time | Date and time the file was created |
| name | Filename |
When you use one of the keywords (all, deleted, or long), the system displays file information in long format. The long format is shown in Table 4-2:
| Column Heading | Description |
|---|---|
| # | File index number |
| ED | Letter to indicate whether the file contains an error (E) or is deleted (D) |
| type | File type (1 = configuration file, 2 = image file); when the file type is unknown, the system displays a zero or FFFFFFFF in this field |
| crc | File cyclic redundancy check |
| seek | Offset into the file system of the next file |
| nlen | Filename length |
| length | File length |
| date/time | Date and time the file was created |
| name | Filename |
The following example shows how to display the file information in short format:
Console> (enable) dir -#- -length- -----date/time------ name 2 3093399 Mar 20 1998 12:33:14 cat5000-sup3.4-1-1.bin 1428272 bytes available (6173904 bytes used) Console> (enable)
The following example shows how to display the file information in long format:
Console> (enable) dir long -#- ED --type-- --crc--- -seek-- nlen -length- -----date/time------ name 2 .. ffffffff 762950d6 6234d0 25 3093399 Mar 20 1998 12:33:14 cat5000-sup3.4-1-1.bin 1428272 bytes available (6173904 bytes used) Console> (enable)
The following example shows the file with index number 1 deleted:
Console> (enable) dir all -#- ED --type-- --crc--- -seek-- nlen -length- -----date/time------ name 1 .D ffffffff 5415406e 3300b8 25 3080247 Mar 12 1998 13:22:46 cat5000-sup3.3-1-1.bin 2 .. ffffffff 762950d6 6234d0 25 3093399 Mar 20 1998 12:33:14 cat5000-sup3.4-1-1.bin 1428272 bytes available (6173904 bytes used) Console> (enable)
Use the format command to format a Flash card. A Flash card must be formatted before it can be used.
format [spare spare-num] [m/]device1: [[device2:][monlib_filename]]| spare spare_num | (Optional) Number of spare sectors to reserve when other sectors fail. |
| m/ | (Optional) Module number of the supervisor engine containing the Flash device. |
| device1: | Flash device to be formatted. |
| device2: | (Optional) Flash device that contains the monlib file to be used to format device1:. |
| monlib_filename | (Optional) Name of the monlib file to use. |
The default number of spare sectors is 0.
Flash command.
Privileged.
A colon (:) is required after the specified device.
You can reserve up to 16 spare sectors for use when other sectors fail. If you do not reserve a spare sector and later some sectors fail, you will have to reformat the entire Flash memory, which will erase all existing data.
The monlib file is the ROM monitor library used by the ROM monitor to access files in the Flash file system. It is also compiled into the system image. In the command syntax, device1: is the device to format and device2: contains the monlib file to use.
When you omit the [device2:][monlib-filename]] argument, the system formats device1: using the monlib that is bundled with the system software.
When you omit device2: from the [[device2:][monlib-filename]] argument, the system formats device1: using the named monlib file from the device specified by the cd command.
When you omit monlib-filename from the [[device2:][monlib-filename]] argument, the system formats device1: using the monlib file from device2:. When you specify the whole [[device2:][monlib-filename]] argument, the system formats device1: using the specified monlib file from the specified device.
You can also specify device1:monlib_filename, as the device and filename to be used, as follows:
format device1: [device1: [monlib_filename]]If monlib_filename is omitted, the system formats device1: using the built-in monlib file on the device.
This example shows how to use the format command:
Console> 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>
Use the pwd command to show the current setting of the cd command.
pwd [[m/]device:]| m/ | (Optional) Module number of the supervisor engine containing the Flash device. |
| device: | (Optional) Device where the Flash resides. |
If no module number or device is specified, pwd defaults to the first module of the active device.
Flash command.
Privileged.
A colon (:) is required after the specified device.
This example shows how to use the pwd command to display the current listing of the cd command:
Console> cd Default flash device set to slot0. Console> pwd slot0
Use the squeeze command to delete Flash files permanently.
squeeze [m/]device:| m/ | (Optional) Module number of the supervisor engine containing the flash device. |
| device: | Device where the Flash resides. |
This command has no default setting.
Flash command.
Privileged.
A colon (:) is required after the specified device.
These examples show how to use the squeeze command to delete the slot0 Flash files and then use the show flash command to confirm the deletion:
Console> squeeze slot0: All deleted files will be removed, proceed (y/n) [n]?y Squeeze operation may take a while, proceed (y/n) [n]?y .......................................................... Console> show flash -#- ED --type-- --crc--- -seek-- nlen -length- -----date/time------ name 1 .. 2 43B312DF 100fc0 15 1052608 Nov 27 1996 10:23:30 cat5k_r47_1.cbi 7336000 bytes available (1052608 bytes used) Console>
Use the undelete command to recover a deleted file on a Flash memory device. The deleted file can be recovered using its index (because there could be multiple deleted files with the same name).
undelete index [[m/]device:]| index | Index number of the deleted file. |
| m/ | (Optional) Module number of the supervisor engine containing the flash device. |
| device: | (Optional) Device where the Flash resides. |
This command has no default setting.
Flash command.
Privileged.
A colon (:) is required after the specified device.
Use the dir command to learn the index number of the file to be undeleted.
A file cannot be undeleted if a valid file with the same name exists. You must delete the existing file before you can undelete the target file.
A file can be deleted and undeleted up to 15 times.
To delete all deleted files permanently on a device, use the squeeze command.
This example shows how to recover the deleted file with index 1, and use the show flash command to confirm:
Console> (enable) undelete 1 bootflash: Console> (enable) Console> (enable) show flash -#- ED --type-- --crc--- -seek-- nlen -length- -----date/time------ name 1 .. ffffffff 5415406e 3300b8 25 3080247 Mar 12 1998 13:22:46 cat5000-sup3 .3-1-1.bin 2 .. ffffffff 762950d6 6234d0 25 3093399 Mar 20 1998 12:33:14 cat5000-sup3 .4-1-1.bin 1428272 bytes available (6173904 bytes used) Console> (enable)
Use the verify command to confirm the checksum of a file on a Flash device.
verify [[m/]device:] filename| m/ | (Optional) Module number of the supervisor engine containing the Flash device. |
| device: | (Optional) Device where the Flash resides. |
| filename | Name of the configuration file. |
This command has no default setting.
Flash command.
Privileged.
A colon (:) is required after the specified device.
This example shows how to use the verify command:
Console> verify cat5k_r47_1.cbi .......................................................... File cat5k_r47_1.cbi verified OK.
Use the whichboot command to determine which file booted.
whichbootNone
This command has no default setting.
Flash command.
Privileged.
This example shows how to use the whichboot command:
Console> whichboot Boot image name is 'bootflash:cat5000-sup3.4-1-1.bin'. Console>
|
|