Section 3-5. File Management and Boot Parameters


3-5. File Management and Boot Parameters

  • Cisco operating systems have many files and file systems that require management.

  • File management consists of managing configuration files and operating system files.

  • COS switches do not require you to save configuration changes.

  • File system commands replace many older file management commands.

  • File system commands enable you to view and classify all files, including files on remote servers.

  • File system commands enable you to copy files with complete path information to eliminate the need for system prompting.

  • Cisco platforms support various Flash file system types.

  • When copying various files into Flash memory, it is important to configure the switch to boot the proper file with boot parameters.

NOTE

Both COS and IOS switches have a new set of file system commands that facilitate file management. Cisco refers to the file system as the IFS or IOS file system. This file system provides an extremely powerful way to manage files within the switch devices and on remote systems. Because it is new, many people are unfamiliar with the commands. To provide backward compatibility, many aliases map to older commands for file management. See Table 3-3 at the end of this section for a listing of the older commands and the IFS equivalent.


Navigating File Systems

1.

View the available file system devices:

COS

 show flash devices 

IOS

 (privileged) show file systems 


This command gives a listing of the file systems available on the device. The COS command lists the writeable file devices. This IOS command lists the total size and the amount of free space on the file system in bytes, the type of file system, the flags for the file system, and the alias name used to access the file system. For IOS devices, file system types include Flash, nonvolatile random-access memory (NVRAM), and network (and some others, such as ROM file systems, that contain microcode). Table 3-1 lists some of the available file systems. Note that not all file systems are available on all platforms.

Table 3-1. Cisco File Systems

Prefix

File System

System:

Contains the system memory, including the running configuration.

Nvram:

Nonvolatile random-access memory. This contains the startup configuration.

Flash:

Flash memory. Typically the location of the IOS. This is the default or starting file system for file system navigation. The prefix flash: is available on all platforms. For platforms that do not have a device named flash:, the prefix flash: is aliased to slot0:. Therefore, you can use the prefix flash: to refer to the main Flash memory storage area on all platforms.

Bootflash:

Boot flash memory. Typical location for Rxboot IOS image.

Supbootflash:

The boot flash for the Supervisor network management processor (NMP). This is from where the Catalyst OS is run.

slot0:

First PCMCIA Flash memory card.

Tftp:

Trivial File Transfer Protocol network server.

ftp:

File Transfer Protocol network server.

slave-nvram:

NVRAM on a redundant Supervisor module running native IOS.

Slave-supbootflash:

The boot flash for the Supervisor NMP on a redundant Supervisor module.

slave-bootflash:

Internal Flash memory on a redundant MSFC running native IOS.

slave-slot0:

First PCMCIA card on a redundant Supervisor module.

Null:

Null destination for copies. You can copy a remote file to null to determine its size.

Rcp:

Remote Copy Protocol (RCP) network server.


2.

Change the default file system directory:

COS

 cd  [filesystem:] 

IOS

 (privileged) cd  [filesystem:] 


Use this command to move to a specific file system or directory within that file system. By moving to a specific file location, you can use file system commands without having to specify the file system: option. If you do a dir command without specifying the file system:, for example, it uses the directory that has been specified by the default directory or the cd command. The default file system directory is Flash.

3.

List the current directory:

COS

 Pwd 

IOS

 (privileged) pwd 


This command prints or displays the name of the working directory to the screen. This command enables you to determine the default file system directory. Use this command to verify that you have moved into the appropriate directory when using cd command.

4.

Display information about the files:

COS

 dir [[m/]device:][filename] [all | deleted | long] 

IOS

 (privileged) dir [/all] [filesystem:][path/filename] 


This command displays a directory of the default directory structure as specified by the cd command. The option /all for IOS or all for COS switches enables you to see all files, including those that have been deleted but not permanently removed from a file system. For COS the option deleted shows you only the files that have been deleted but not permanently removed. The option long shows filenames in long-name format. For COS machines, you can use the m before the device name to specify a module number. You can also specify a file system by using the filesystem: or device: option. If you want to view a single file, provide the path and filename also. You can use an asterisk (*) as a wildcard to display a group of files with common starting characters. You can use this command to get a list of files off of any available local file system:

COS

 show filesystem: 

IOS

 (privileged) show filesystem: 


This command displays the contents of a file system. It is similar to the dir command, but the output is formatted differently. This command does not enable you to display individual files or remote file systems.

5.

View the information about a local or remote file:

COS

N/A

IOS

 (privileged) show file information filesystem:path 


This command enables you to view information about a file on a remote or local file system. The output displays the image type and size.

6.

View the contents of a local or remote file:

COS

 show file [device:] filename [dump] 

IOS

[View full width]

 (privileged) more [/ascii | /binary | /ebcdic]  filesystem:path 


Use this command to view the contents of a remote or local file. The options ascii, binary, and ebcdic enable you to specify the type of format in which you want to have the file presented. For COS the default is ASCII format. If you specify dump, it shows the file in binary format. The filesystem:path options enable you to specify a particular file on a valid file systemfor example, more /ascii flash:myconfig.txt displays the file myconfig.txt in ASCII format located in the current Flash device.

Deleting Files from Flash

Cisco switch platforms have three different classifications of file systems. Each of these file systems deals differently with deleting and permanently removing files from the Flash file system. Table 3-2 shows the three types of file systems and the platforms that use these file systems.

Table 3-2. Switch File System Types

File System Type

Platforms

Class A

Catalyst 5000, 6000, 4000, 2948G, 4908G

Class B

Catalyst 2948G-L3, 4908G-L3

Class C

Catalyst 2900/3500XL, 3550, 2950


1.

Delete a file from Flash memory:

COS

 delete [filesystem:]filename 

IOS

 (privileged) delete [filesystem:]filename 


This command deletes a file from Flash on any of the three classifications of file systems. For Class A and B file systems, the file is marked as deleted and shows up only if the command dir /all is used. You can restore files that are marked as deleted by using the undelete command. For Class C file systems, the delete command permanently removes the file from the system. The file system must be a Flash file system.

2.

Restore a deleted file:

COS

 undelete index [filesystem:] 

IOS

 (privileged) undelete index [filesystem:] 


For a Class A file system, if a file has been deleted, you can restore the file by using the undelete command. You must provide the index number of the file listed by using the dir /all command. If the file is not located in your working directory, determined by the pwd command, you can specify the filesystem: option.

3.

Permanently remove a file from Class A Flash memory:

COS

 squeeze filesystem: 

IOS

 (privileged) squeeze filesystem 


If you want to permanently remove a file that has been deleted from a Class A file system, you must squeeze the file system. This command permanently removes any file on the file system that has been marked as deleted.

4.

Remove a file from Class B Flash memory or NVRAM:

COS

N/A

IOS

[View full width]

 (privileged) delete [flash:/filename | bootflash: /filename | nvram:/filename] 


To remove a file on a Class B Flash device, use the delete command. When you delete a file from a Class B Flash device, it remains in Flash memory and retains the memory space used. To permanently remove a file from a Class B file system, you must reformat the file system. Because this removes all files, you should save OS files and copy them back to memory after you reformat the device:

COS

 format filesystem: 

IOS

 (privileged) format filesystem: 


For Class A and Class C devices, you can also remove all the files and reformat the device by using the format command.

Moving System Files

Like on most computer systems, it is important to move the files from one location to another. To move system files, you can use the copy command. This command, along with path parameters, moves the system files. The results of some file system moves are uniquewhen a file is copied into the system:running-configuration file, for example, the result is a file merge. This section discusses some common copy commands and the results. On the whole, however, you can move files into file systems that enable you to write to the system. The command structure for copy commands is copy [/erase] source-location destination-location. The source location and destination location can be any writeable file system and path. By using the /erase option, you can always erase the destination of a writeable file system before source the file is copied. The source location can be any file system that contains files that need to be moved. With all of these commands, you can specify the address and filename or you can leave them out and the system will prompt you for information.

1.

Save the active configuration file to be used for startup:

COS

Not required (this is automatic)

IOS

[View full width]

 (privileged) copy system:running-config nvram :startup-config 


This command copies the system's current active configuration into the startup configuration file. When anything is copied into the location nvram:startup-configuration, it is a complete overwritethat is, any information that was in that file is completely lost and overwritten with the source file. The startup configuration file is loaded at startup. For COS, this is automatic and not required.

2.

Copy a file into active configuration:

COS

 copy [[m/]device:][filename] config 

IOS

 (privileged) copy source system:running-config 


This command copies a file into the current running configuration. The source/device can be any location that contains a text file that has configuration parameters framed in the appropriate syntax. When files are copied into running configuration, they are merged with the current configuration. That is, if a configuration parameter (such as an address) exists in both placesrunning configuration and the source configurationthe running configuration will be changed by the parameter that is being copied from the source location. If the configuration parameter exists only in the source location, it is added to the running configuration. In the case that a parameter exists in running configuration, but is not modified in the source configuration, there is no change to the running configuration. The source location can be a file in any location, including a file on a TFTP server, FTP server, or a text file that has been written to Flash memory.

3.

Save a file to a TFTP server:

COS

 copy [[m/]device:][filename] tftp 

IOS

 (privileged) copy source tftp://address/filename 


This command enables you to save any readable file from an IFS source location to a TFTP server specified in the address of the destination parameter. If you do not supply a filename and address, the system prompts for this information.

4.

Save a file to Flash memory:

COS

[View full width]

 copy [[m/]device:][filename] flash-filesystem:/ /path/filename 

IOS

[View full width]

 (privileged) copy source flash-filesystem://path /filename 


You can copy a file into any Flash file system of a router with the copy commands. Some writeable file systems, such as a Class A file system, enable you to create and write to directories and files. This copy command enables you to move files into a Flash file system. Files that are moved into Flash are usually IOS files; however, you can use Flash to store any file as long as you have room to place the file. If fact, after a file has been placed into Flash memory, the router can be configured as a TFTP server and can then serve that file to other devices. Refer to the related commands portion of section "1-2: Cisco Internetwork Operating System (IOS) Software" for more information about configuring your router to act as a TFTP server.

File System Boot Parameters

1.

Specify an OS image to boot from in a Flash file system:

COS

[View full width]

 set boot system flash device:[filename] [prepend]  [mod] 

IOS

[View full width]

 (global) boot system flash flash-filesystem: /directory/filename 


By default, switches boot the first valid image in the default Flash location. If you have more than one file in Flash memory and you do not want to boot the first file, you must specify which file is to be used as the IOS image. For COS devices, you can manipulate the order with the prepend option in the command. The boot system flash command specifies which file to use.

2.

Change the configuration file environmental parameter for Class A file systems:

COS

 set boot auto-config device:directory/filename 

IOS

 (global) boot config device:directory/filename 


For a Class A file system, you can copy configuration files to the Flash file system. You can also specify that some switches are to load a configuration from Flash instead of the startup configuration file located in NVRAM. To do this, you must first copy the active configuration into the Flash file system, and then in global configuration use the boot config parameter followed by the file system name and file location and name. After you save this configuration, the router attempts to load the configuration from the specified location.

Alias Commands

Because the new file system functionality is the third generation of file management system for Cisco IOS and COS, alias commands have been established to provide backward compatibility for commands that existed in previous operating systems. This backward compatibility enables you to use file management commands that you might have learned in previous releases without having to relearn the new command structure. Table 3-3 show the alias commands and the IFS equivalent command and COS command.

Table 3-3. File Management Alias Commands

Cisco IOS Software Release 10.2 and Earlier Command

Cisco IOS Software Release 10.3 to 11.3 Command

Cisco IOS Software Release 12.0 and Later (IFS) Command

COS Commands

write terminal

show running-config

show system:running-config or more system:running-config

show config

-or-

write terminal

show config

show startup-config

show system:startup-config or more system:startup-config

show config or write terminal

write memory

copy running-config startup-config

copy system:running-config nvram:startup-config

No equivalent. Automatically saves all configuration changes.

write erase

erase startup-config

erase nvram:

clear config all

write network

copy running-config tftp:

copy system:running-config tftp://address/filename

Write network or copy config tftp

config memory

copy startup-config running-config

copy nvram:startup-config system:running-config

No equivalent. There is no difference between startup and running.

config network

copy tftp running-config

copy tftp://address/filename system:running-config

config network or copy tftp config

config overwrite

copy tftp startup-config

Copy tftp://address/filename nvram:startup-config

No equivalent.

Cisco's official stance on older commands is that they might not be supported in future releases, so it is conceivable that commands that existed before Release 12.0 might not be supported in future releases of Cisco IOS.




Cisco Field Manual. Catalyst Switch Configuration
Cisco Field Manual. Catalyst Switch Configuration
ISBN: 1587050439
EAN: N/A
Year: 2001
Pages: 150

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net