Managing startup-config files in the switch

Managing the startup-config files involves renaming, copying, and erasing startup-config files.

  • Use the rename config <current-filename> <new-filename> command to change the name of an existing startup-config file. The current-filename argument specifies the existing startup-config file and the new-filename argument specifies the new name for the file.

    A file name can include up to 63, alphanumeric characters. Blanks are allowed in a file name enclosed in quotes (" " or ‘ ‘). File names are not case-sensitive.

    A file name can include up to 63, alphanumeric characters. Blanks are allowed in a file name enclosed in quotes (" " or ‘ ‘). File names are not case-sensitive.

    For redundant management systems, renaming a config file affects both the active management module and the standby management module, unless redundancy is disabled or the standby module failed selftest.

  • Use the copy config <source-filename> config <target-filename> command to create a new startup-config file or to replace an existing startup-config file with a new one.

    This command copies the contents of an existing startup-config file in one memory slot to a new startup-config file in another, empty memory slot.

    If the target startup-config file already exists, it is overwritten by the content of the source startup-config file otherwise, it will be created in the first empty configuration memory slot on the switch. If the destination startup-config file does not already exist and there are no empty configuration memory slots on the switch, then a new startup-config file is not created.

  • Do one of the following to erase any of the startup-config files in the switches memory slots:

    • Use the erase config <filename> command to erase the specified startup-config file. filename argument

      specifies the file to be erased.

    • Use the erase startup-config command to erase the currently active startup-config file.

In some cases, erasing a file causes the switch to generate a new, default-configuration file for the affected memory slot. Where a file is assigned to either the primary or the secondary flash, but is not the currently active startup config file, erasing the file does not remove the flash assignment from the memory slot for that file. Thus, if the switch boots using a flash location that does not have an assigned startup-config, then the switch creates a new, default startup-config file and uses this file in the reboot. (This new startup-config file contains only the default configuration for the software version used in the reboot.) Executing write memory after the reboot causes a switch-generated filename of config x to appear in the show config files display for the new file, where x corresponds to the memory slot number.

In a redundant management system, these commands erase the startup config file on both the active and the standby management modules as long as redundancy has not been disabled. If the standby management module is not in standby mode or has failed selftest, the startup config file is not erased.

The following example shows how to create and assign a new startup config file

If you wanted to experiment with configuration changes to the software version in secondary flash, you could create and assign a separate starup-config file for this purpose, as shown in the following command sequence.
switch(config)# copy config config1 config config2
switch(config)# startup-default secondary config config2
switch(config)# show config files

Configuration files:

id | act pri sec | name
---+-------------+-----------------------------------------------
 1 |  *   *      | Config1
 2 |          *  | Config2
 3 |             | 

The following example shows how to erase a non-active startup-config file. The memory configuration has a non-active configuration file named “config3”, which you want to erase.

switch(config)# show config files

Configuration files:

id | act pri sec | name
---+-------------+-----------------------------------------------
 1 |  *   *      | minconfig
 2 |          *  | config2
 3 |             | config3

switch(config)# erase config config3
switch(config)# show config files

Configuration files:

id | act pri sec | name
---+-------------+-----------------------------------------------
 1 |  *   *      | minconfig
 2 |          *  | config2
 3 |             |